Skip to content

Instantly share code, notes, and snippets.

View saikat's full-sized avatar

Saikat Chakrabarti saikat

View GitHub Profile
var {nodeInterface, nodeField} = nodeDefinitions(
(globalId) => {
var {type, id} = fromGlobalId(globalId);
if (type === 'Person')
return Person.get(id);
if (type === 'Group')
return Group.get(id);
if (type === 'CallAssignment')
return CallAssignment.get(id);
if (type === 'Call')
import os, json
from bsdapi.BsdApi import Factory
from bsdapi.RequestGenerator import RequestGenerator
from bsdapi.URL import URL
from django.conf import settings
from time import time
api = Factory().create(
id=settings.BSD_ID, secret=settings.BSD_SECRET,
host=settings.BSD_HOST, port='80',
0.3.2 request payload: {"query":"query AppHomeRoute{widget(id:\"hi\"){id,...__RelayQueryFragment024i1nd}} fragment __RelayQueryFragment024i1nd on Widget{name,id}","variables":{}}
0.4.0 request payload: {"query":"query AppHomeRoute{widget{id,...__RelayQueryFragment024i1nd}} fragment __RelayQueryFragment024i1nd on Widget{name,id}","variables":{}}
We couldn’t find that file to show.
[11:05:24] <saikat> what is exit code 128 in the context of a docker container? I just had a very strange situation where my docker daemon was tking up tons of memory. I tried killing one container, and that caused all my containers to die with exit code 128
[11:05:27] <exarkun> You expect people to know your private definition of "really"? :)
[11:05:28] <cpuguy83> exarkun: DB process crashed, db is corrupted, db process won't start.
[11:05:53] intellix (~intellix@c2-208.i07-1.onvol.net) joined the channel.
[11:06:00] liranp (~liranp@46.117.212.98) joined the channel.
[11:06:54] plucas (~plucas@rrcs-24-199-133-109.midsouth.biz.rr.com) left IRC. (Ping timeout: 245 seconds)
[11:06:55] <saikat> and now removing the dead containers is complaining about "Error response from daemon: Cannot destroy container 484eb73e02f9: Driver devicemapper failed to remove root filesystem 484eb73e02f92f31f323a568b4e4f699ebf119e238abb5faa14b2b04a6b9ba50: Device is Busy"
[11:07:05] ostera (~ostera@host219.190-139-126.telec
location = / {
alias /mockingbird/frontend/static/;
}
location / {
proxy_pass http://backend;
}
def remote_log_tailer(host, log_file=''):
line_number = 1
inventory_file = "ansible/%s" % env['environment']
while True:
output = check_output(["/usr/local/bin/ansible", host, "-i", inventory_file, "-a", "tail -n +%s %s" % (str(line_number), log_file)], env={'ANSIBLE_HOST_KEY_CHECKING' : str(env['check_host_key'])}, stderr=STDOUT)
output_lines = output.strip().splitlines()
output_lines.pop(0)
if len(output_lines) > 0:
line_number = line_number + len(output_lines)
print bcolors.OKGREEN + '\n'.join(output_lines) + bcolors.ENDC
/*
* AppController.j
* TestScrollBug
*
* Created by You on March 10, 2014.
* Copyright 2014, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
found_previously_successful_charge = false
Card.load_all({:number => card.number, :merchant => card.merchant}, {:limit => 10, :sort => [[:created, :desc]]}) do |c|
Charge.load_all({:merchant => card.merchant, :livemode => card.livemode, :authorized => true, :card => card.token}, {:limit => 2}) do |ch|
if ch.token != charge.token
found_previously_successful_charge = true
break
end
end
@saikat
saikat / linkify.js
Created March 16, 2012 04:23
Bookmarklet to add links in front of all tags with ids
<a href="javascript:(function() { eles = $('*[id]'); eles.each(function(index, element) { var linkName = $(this).attr('id'); var link = $('<a></a>'); link.attr('href', '#' + linkName); link.text('# '); $(this).prepend(link); }); })()">Linkify</a>