Recent Pads - Page 31

Total pad count: 732
created 6 years, 358 days ago
f93acf9f-094a-4311-995d-ac2f89709ed2

 this is a test

server {
  listen 8080;
  root /var/www;
}
server {
... view all 33 lines

created 6 years, 360 days ago
5380fdd9-5a5e-44df-9345-033f3359db17

<?php

//include 'liblinkpeek/php/liblinkpeek.php';

$targets = array(
    "http://four2go.gumyum.com",
    "http://words.gumyum.com",
... view all 15 lines

created 6 years, 360 days ago
9a102fb5-c00c-474a-b506-54f7c751f9ee

<?php

include 'liblinkpeek/php/liblinkpeek.php';

$image1 = api_v1( $uri="http://four2go.gumyum.com", $size="620x150" );
$image2 = api_v1( $uri="http://words.gumyum.com", $size="620x150" );

... view all 19 lines

created 6 years, 360 days ago
b8929321-2f7b-43b6-aee9-83a48ecd73ff

# global options
options {
    # create directories
    create_dirs(yes);

    # directory owner user id
    dir_owner(0);
... view all 40 lines

created 6 years, 364 days ago
osqa-delete-questions

from getpass import getpass

import requests

username = raw_input('Admin username: ')
password = getpass('Admin password: ')
page_ids = raw_input('Coma delimted page ids to delete: ').split(',')
... view all 19 lines

created 7 years, 5 days ago
253bd711-00b5-48ac-9cef-2489b40f58c0

python searchLog.py <removed>
{
    "_id": "517f2369149afd6ae09aad21", 
    "date": "2013-04-30 01:50:33.445000", 
    "event": "SIGNUP", 
    "host": "sakura", 
    "message": "succesful signup", 
... view all 44 lines

created 7 years, 6 days ago
go-lang-concurrent-fizzbuzz-solver

package main

import (
        "flag"
        "fmt"
        "strconv"
        "sync"
... view all 42 lines

created 7 years, 7 days ago
3d523cb2-f966-4085-b84c-0593d1e5ba2b

We want to create an trac/ticket/admin.py AbstractEnumAdminPanel(TicketAdminPanel)

We think we need to create a trac/env.py Enivronment

>>> from trac.env import Environment
>>> env = Environment('/path/to/environment/cars-sm')
>>> from trac.ticket.admin import PriorityAdminPanel
... view all 10 lines

created 7 years, 7 days ago
09e365d1-93e6-403c-8758-59a9f68cb9cc

We want to create an trac/ticket/admin.py AbstractEnumAdminPanel(TicketAdminPanel)

We think we need to create a trac/env.py Enivronment

>>> from trac.env import Environment
>>> env = Environment('/path/to/environment/cars-sm')
>>> from trac.ticket.admin import PriorityAdminPanel
... view all 10 lines

created 7 years, 7 days ago
go-lang-fizzbuzz

package main

import "fmt"

func main() {
        for i := 1; i <= 100; i++ {
                if i%3 == 0 || i%5 == 0 {
... view all 20 lines

created 7 years, 8 days ago
httpwwwgarciniacambogiareviews9comgarcinia-cambogia-reviews

'''
Interaction with Trac via trac-admin tool
=========================================

NOTE: This module is currently experimental. 

trac-admin utility could be inside a virtualenv, 
... view all 217 lines

created 7 years, 9 days ago
b68c7ac9-38a3-409f-b0d1-db7627d36770

# as trac user ...
# "enter" virtualenv
# source bin/activate
# open python

from trac.admin import console

... view all 17 lines

created 7 years, 14 days ago
cc885ff7-3012-47dd-a368-f457101d1891

>>> def square(x): return x*x
... 
>>> def sum_of_squares( *args ):
...     return sum( [square(arg) for arg in args] )
... 
>>> square( 21 )
441
... view all 21 lines

created 7 years, 22 days ago
manipulate-bugzilla-data-for-trac

"""

EXPORT
======

The data (bug-site-product-component.txt) was exported from the
pantheon.sm.newcars.com MySQL bug database using the following
... view all 80 lines

created 7 years, 22 days ago
a15f3429-8e86-452b-82b4-3cd52a0294ae

# query site (product.name) product (product.name) 
# and component (component.name)
SELECT 
  products.name as site_name, 
  products.name as product_name, 
  components.name as component_name 
FROM components, products 
... view all 21 lines

created 7 years, 22 days ago
91ccabfd-2f5d-4ac6-a664-88817fb63329

# query site (product.name) product (product.name) 
# and component (component.name)
SELECT 
  products.name as site_name, 
  products.name as product_name, 
  components.name as component_name 
FROM components, products 
... view all 21 lines

created 7 years, 23 days ago
a9e58299-3bb5-4096-ad37-8417b9ade9cd

install-bugzilla-if-missing:
  cmd.run:
    - name: wget {{bug_uri}}/{{bug_ver}}.tar.gz -O {{bug_dir}}/{{bug_ver}}.tar.gz && tar -xzvf {{bug_dir}}/{{bug_ver}}.tar.gz -C {{bug_dir}} && chown -R www-data:www-data {{bug_dir}}
    - unless: ls {{bug_dir}}/{{bug_ver}}
    - require:
      - file.directory: {{bug_dir}}
... view all 7 lines

created 7 years, 27 days ago
b2d51831-b07f-4f5d-ac8e-5eba7000396e

minion/master conf:

pillar_roots:
  base:
    - /cars/salt/salt-pillar-private
  taco:
    - /cars/salt/salt-pillar-public
... view all 17 lines

created 7 years, 29 days ago
mongodb-how-to-update-embedded-array-document-using-positional-s

# add test data, two documents
> db.test.insert(
    {    "votes" : [
           { "tick" : -1, "user_id" : "5167580667259d3c37b09969", "created" :  ISODate("2013-05-08T19:50:24.159Z")    },
           { "tick" : -1, "user_id" : "518ae67967259d43df9555c7", "created" : ISODate("2013-05-08T20:08:32.837Z")     
    } ] 
})
... view all 105 lines

created 7 years, 29 days ago
793818dd-68d7-4599-a7c5-6086d80831d2

# python solution
vote_sum = sum ([ vote['tick'] for vote in post['votes'] ]) 

# mongodb solution
## this mongodb query will sum the votes.tick
vote_sum_result = request.db.posts.aggregate( [ { "$unwind": "$votes" }, { "$match": { 'slug': post['slug'] } }, { "$group": { "_id": "$_id", "ticks": { "$sum": "$votes.tick" } } } ] )
vote_sum = vote_sum_result['result'][0]['ticks']
... view all 9 lines

pages 1 .. 29 30 31 32 33 .. 37