Skip to content

Instantly share code, notes, and snippets.

@torsten
torsten / navajo.rb
Last active September 3, 2015 17:45
Navajo, a stupid simple Apache replacement (kinda)
#!/usr/bin/env ruby
# Copyright 2009-2014 Torsten Becker
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
@rti
rti / gist:1605397
Created January 13, 2012 10:09
KISS cpp profiling - easy to use cpu time measurement helper
/*
* USAGE:
* #include <ctime>
* ...
* void your_func() {
* measure_time t(__func__);
* // your code...
* }
*/
struct measure_time {
@hanshasselberg
hanshasselberg / .vimrc
Last active September 30, 2015 22:07
Vim configuration
set nocompatible
filetype off
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
set nobackup
set nowritebackup
set noswapfile
set history=1000
set ruler
@larsxschneider
larsxschneider / jsmethods.js
Created March 30, 2012 13:50
Render all JS methods
function getMethods(obj) {
var result = [];
for (var id in obj) {
try {
if (typeof(obj[id]) == "function") {
result.push(id + ": " + obj[id].toString());
}
} catch (err) {
result.push(id + ": inaccessible");
}
@mikeash
mikeash / test.m
Created July 9, 2012 21:15
Cocoa array slicing
// clang -framework Foundation -fobjc-arc -O3 test.m
#import <Foundation/Foundation.h>
@interface Slice : NSObject
@property NSInteger start;
@property NSInteger length;
@end
@implementation Slice
@agnoster
agnoster / github.com.js
Created October 17, 2012 15:59
Like editing files in an open pull request?
/**
* 1) Use http://defunkt.io/dotjs/
* 2) Install this into ~/.js/github.com.js
* 3) Enjoy a button to edit any file on a pull request (some restrictions may apply, void where prohibited)
*
* Note: this will replace the "View file @ ...", which I find pretty useless (and it's contained in the edit mode,
* anyway). However, if you want to look at files where you don't have access to edit them, this will suck.
*/
function getBranch() {
@larsxschneider
larsxschneider / github.com.js
Created October 31, 2012 17:25 — forked from agnoster/github.com.js
View/edit a file in a pull request by clicking on the line number.
/**
* 1) Use http://defunkt.io/dotjs/
* 2) Install this into ~/.js/github.com.js
* 3) Click on a line number in the editor to open the file at this position (e.g. to see more context)
* 4) Alt+Click on a line number in the editor to edit the file at this position
*
* This script is based on @agnoster's idea: https://gist.github.com/3906361
*/
function getBranch() {
@y0ast
y0ast / Tutorial.md
Last active November 23, 2015 03:11
Tutorial for using Torch7 on Amazon EC2 GPUs

There used to be a tutorial here for using Torch7 on EC2, but it's now outdated. It is best to use an EC2 image that already has Torch7 and CUDA stuff preinstalled.

@fs111
fs111 / gist:7013230
Created October 16, 2013 19:18
These are the notes from my talk about lingual during the big data beer meetup in Berlin: http://www.meetup.com/Big-Data-Beers/events/143392512/

Lingual - ANSI SQL for apache hadoop

Big Data Beers Berlin, October 16th 2013

Speaker

  • André Kelpe | @fs111 | andre[at]concurrentinc[dot]com
  • works for concurrent inc (http://concurrentinc.com)
    • company behind Cacading and Lingual

Cascading

@jehiah
jehiah / check_forkrate.sh
Created January 19, 2014 21:32
check_forkrate.sh script to monitor system fork rate with nagios
#!/bin/bash
# Copyright bitly, Aug 2011
# written by Jehiah Czebotar
DATAFILE="/var/tmp/nagios_check_forkrate.dat"
VALID_INTERVAL=600
OK=0
WARNING=1
CRITICAL=2