Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| from facebook_analytics_service.tasks import * | |
| all_latency = [(timezone.now() - x).seconds for x in AdAccount.objects.filter(adcreative_last_crawled__isnull=False, should_crawl=True).values_list('adcreative_last_crawled', flat=True)] | |
| max(all_latency) |
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
| var musicmetadata = require('musicmetadata'); | |
| addDragDropListener(document, function (files) { | |
| musicmetadata(files[0], { duration: true }) | |
| .on('metadata', function (result) { | |
| console.log(result); | |
| if (result.picture.length > 0) { | |
| var picture = result.picture[0]; | |
| var url = URL.createObjectURL(new Blob([picture.data], {'type': 'image/' + picture.format})); | |
| var image = document.createElement('img'); |
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
| """ List duplicate celery tasks in redis queues """ | |
| import datetime | |
| import redis | |
| import json | |
| import base64 | |
| import pickle | |
| from collections import Counter | |
| import argparse | |
| import sys |
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
| #!/bin/bash | |
| # shell script to create a simple mongodb replica set (tested on osx) | |
| set -e | |
| red=$(tput setaf 1) | |
| green=$(tput setaf 2) | |
| yellow=$(tput setaf 3) | |
| default=$(tput sgr0) |
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
| var http = require('https'); | |
| var musicmetadata = require('musicmetadata'); | |
| http.get('https://dl.dropbox.com/u/1269592/Into%20The%20Back%20%28WORNG%20Remix%29.mp3', function (res) { | |
| var parser = new musicmetadata(res); | |
| parser.on('metadata', function (result) { | |
| console.log(result); | |
| }); | |
| parser.on('done', function (err) { | |
| if (err) throw err; |
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
| #!/bin/bash | |
| # usage: time benchbulk.sh dbname | |
| # it takes about 30 seconds to run on my old MacBook | |
| BULKSIZE=1000 | |
| DOCSIZE=100 | |
| INSERTS=10 | |
| ROUNDS=10 | |
| DBURL="http://localhost:5984/$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
| test: test.obj | |
| g++ test.o -o kdssvolumeinfo_node.node -L/usr/local/lib $(KDSS_SLIB_NAME) -shared | |
| test.obj: | |
| g++ $(CPPLAGS) $(CFLAGS) -g -fPIC -DPIC -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DEV_MULTIPLICITY=0 $(INCLDIRS) -I/usr/local/include/node kdssvolumeinfo_node.cpp -c -o test.o |
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
| wchar_t* command = L"my command"; | |
| int len = wcslen(command) + 1; | |
| wchar_t* w_msg = (wchar_t*)malloc(sizeof(wchar_t) * len); | |
| wcscpy(w_msg, command); | |
| free(w_msg); |
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
| git filter-branch -f --env-filter 'if [[ "$GIT_COMMIT" = "119900cd7054c64f2b8e4774e59afbfc39a28e73" ]]; then export GIT_COMMITTER_NAME="Lee Treveil" GIT_AUTHOR_NAME="Lee Treveil" GIT_COMMITTER_EMAIL="[email protected]" GIT_AUTHOR_EMAIL="[email protected]"; fi' HEAD |