Skip to content

Instantly share code, notes, and snippets.

View bryanhelmig's full-sized avatar
Zapier is hiring!

Bryan Helmig bryanhelmig

Zapier is hiring!
View GitHub Profile
{
"name": "My Fancy Zap Title",
"link": "https://zapier.com/app/edit/12345",
"trigger": {
"service": {
"name": "Service Name (like Github)",
"logos": {
"16x16": "https://cdn.zapier.com/path/to/image.16x16.png",
"32x32": "https://cdn.zapier.com/path/to/image.32x32.png",
"64x64": "https://cdn.zapier.com/path/to/image.64x64.png"
results = JSON.parse(bundle.response.content);
// assuming results is an array of objects, object being the full json you pasted
out = _.map(results, function(result){
// handle properties, ignoring versions
result.properties = _.object(_.map(result.properties, function(valueSet, key){
return [key, valueSet.value];
}));
// similar code to handle examples of {key: Array()}, maybe using _.first?
return result;
traceroute: Warning: d2glos6gx2bw40.cloudfront.net has multiple addresses; using 205.251.215.209
traceroute to d2glos6gx2bw40.cloudfront.net (205.251.215.209), 64 hops max, 52 byte packets
1 unknown (192.168.1.1) 0.481 ms 0.399 ms 0.348 ms
2 71.204.164.1 (71.204.164.1) 96.459 ms 29.902 ms 19.931 ms
3 te-0-1-0-4-ur05.santaclara.ca.sfba.comcast.net (68.86.248.17) 10.354 ms 8.242 ms 9.542 ms
4 te-1-1-0-3-ar01.sfsutro.ca.sfba.comcast.net (68.85.155.62) 22.286 ms
te-1-1-0-2-ar01.sfsutro.ca.sfba.comcast.net (68.85.155.58) 9.923 ms
te-1-1-0-1-ar01.sfsutro.ca.sfba.comcast.net (69.139.198.90) 22.058 ms
5 he-1-6-0-0-cr01.sanjose.ca.ibone.comcast.net (68.86.90.157) 15.108 ms 18.198 ms 12.607 ms
6 xe-11-0-0.edge1.sanjose1.level3.net (4.79.43.137) 26.000 ms 26.451 ms 27.229 ms
"limits": {
"zap_limit": -1,
"action_limit": -1,
"actions_this_period": 4,
"app_blacklist_list": [],
"allotment": [
{
"count": 1,
"percent": 0,
"limit": "unlimited",
class AnnotateManager(models.Manager):
def get_query_set(self):
return super(AnnotateManager, self).get_query_set()\
.extra(select={'has_prefill': 'ISNULL(prefill)'})\
.order_by('-has_prefill', '-required', 'id')
@bryanhelmig
bryanhelmig / setup-statsd.sh
Created August 10, 2012 00:10 — forked from rw/setup-statsd.sh
Turn an Ubuntu 11.10 EC2 into a StatsD/Graphite server
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
sudo apt-get install nodejs
# install the Node package manager for later use
curl http://npmjs.org/install.sh | sudo sh
sudo npm install express
# clone the statsd project
git clone https://github.com/etsy/statsd.git
# download everything for graphite
import random
start = 0.05
end = 0.2
interval = 11
intervals = [0.0] * interval
step = (end - start) / (interval * 2) # adjust to taste, coarser might feel more "random"
# only continue while the gap between start and end isn't closed
#!/usr/bin/python
"""
first, install requests and oauth hook:
> sudo pip install requests requests-oauth -U
then run:
> python qbrequests.py
first = 1, 2, 3
second = 1, null, null
result = _.all _.zip(first, second), (li) ->
if not li[1]?
return true
else if li[0] == li[1]
return true
else
return false
@bryanhelmig
bryanhelmig / py.py
Created May 15, 2012 17:54
queue examples
# bad way
def new_message(request):
user = get_user_or_404(request)
message = request.POST.get('message', None)
if not message:
raise Http404
user.save_new_message(message)