This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import urlparse | |
| import oauth2 as oauth | |
| import urllib | |
| import sys | |
| import json | |
| from pymongo import json_util | |
| consumer_key = 'CONSUMERKEY' | |
| consumer_secret = 'CONSUMERSECRET' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| restparams['method'] = 'oauth_access' | |
| resp, content = client.request(url, "POST", body=urllib.urlencode(restparams)) | |
| print resp | |
| print content | |
| cont = json.loads(content) | |
| sess = cont["id"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $jq = new SugarJobQueue(); | |
| $job = new SchedulersJob(); | |
| $job->name = "My Job"; | |
| $job->target = "function::myjob"; | |
| $jobid = $jq->submitJob($job); | |
| echo "Created job $jobid!\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import collections | |
| import re | |
| import itertools | |
| macros = collections.defaultdict(list) | |
| f = open(sys.argv[1]) | |
| for l in f: | |
| l = l.strip() | |
| comps = l.split("\t") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| array("op" => "OR", args => array( | |
| array("op" => "AND", args => array( | |
| array("op" => "!=", "args" => array("$contacts.state", "CA")), | |
| array("op" => "!=", "args" => array("$contacts.state", "OH")), | |
| )), | |
| array("op" => "=", args => array("$contacts@2.accounts.contacts.state", 'CA')), | |
| array("op" => "=", args => array("$opportunities.contacts.state", 'CA')), | |
| )) | |
| SELECT DISTINCT meetings.id, ... FROM meetings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h1>Hello {{getFieldValue model "name"}}</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {name: "SugarCon"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // get args | |
| if($argc < 3) { | |
| echo "Use: $argv[0] /path/to/php-5.4.16/NEWS 5.4.16\n"; | |
| exit(1); | |
| } | |
| // find NEWS entry | |
| $fp = fopen($argv[1], "r"); | |
| if(!$fp) { | |
| die("Can not open $argv[1]"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| f = open(sys.argv[1], 'r') | |
| txt = f.readline().strip() | |
| patterns = [p.strip() for p in f] | |
| f = open(sys.argv[2], 'r') | |
| answers = [int(i) for i in f.readline().strip().split(' ')] | |
| anset = set() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| array(9) { | |
| ["Accounts"]=> | |
| array(5) { | |
| [0]=> | |
| string(15) "billing_address" | |
| [1]=> | |
| string(16) "shipping_address" | |
| [2]=> | |
| string(15) "phone_alternate" | |
| [3]=> |