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
db.eval(" | |
db.logs.find().forEach(function (d) {db.newlogs.insert(d)}); | |
db.logs.renameCollection('bak', true); | |
db.newlogs.renameCollection('logs', true); | |
"); |
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
# Configs | |
config windowHintsShowIcons true | |
config windowHintsIgnoreHiddenWindows false | |
config windowHintsSpread true | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize | |
config secondsBetweenRepeat 0.1 | |
config checkDefaultsOnLoad true | |
config focusCheckWidthMax 3000 |
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
func main() { | |
var operand_p *float64 = new(float64) | |
flag.Float64Var(operand_p, "operand", math.NaN(), "sqrt operand") | |
flag.Parse() | |
if math.IsNaN(*operand_p) { | |
var err error | |
*operand_p, err = strconv.ParseFloat(flag.Arg(0), 64) | |
if err != nil { | |
log.Fatal(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
@app.route('/img/<ObjectId:gitshot_id>') | |
def render_image(gitshot_id): | |
img = mongo.db.gitshots.find_one_or_404(gitshot_id, {'img': True})['img'] | |
def wsgi_app(environ, start_response): | |
start_response('200 OK', [('Content-type', 'image/jpeg')]) | |
return img | |
return make_response(wsgi_app) |
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
ranman ⮀ Downloads ⮀ cat test.cpp ⮂ 00:20:11 ⮂ 2013-04-18 | |
#include <iostream> | |
#include <fstream> | |
#include <streambuf> | |
#include <string> | |
#include <cerrno> | |
using namespace std; | |
std::string get_file_contents(const char *filename) | |
{ |
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
{ | |
"_id": ObjectId("5168940332e9bc755385e947"), | |
"author": "ranman", | |
"ts": ISODate("20130412T15:08:48-0400"), | |
"project": "corp", | |
"msg": "almost working version of employees", | |
"dstats": [ | |
{ | |
"+": "15", | |
"-": "3", |
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/env python2.7 | |
# this is an awesome githook by randall at 4am. | |
# now to get back to real work | |
import os | |
import getpass | |
import subprocess | |
import time | |
import json | |
import requests | |
from datetime import datetime |
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
user www-data; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { |
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
#include <stdio.h> | |
int main() { | |
#pragma pack(push, 1) | |
struct X { | |
char a; | |
double b; | |
char c; | |
int d; | |
double e; | |
float f; |
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
perl -E '@P=split//,".URRUU\c8R";@d=split//,"\nbeewd nohtyP a si lladnaR";sub p{ | |
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord | |
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&& | |
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print' |