Skip to content

Instantly share code, notes, and snippets.

View jimeh's full-sized avatar

Jim Myhrberg jimeh

View GitHub Profile
@geoah
geoah / 1-0-Preface.md
Last active March 2, 2016 17:42
[RFC]

Preface

TL;DR

This is a rant about how a decentralized network for storing structured data might look like.
The goal is to allow third party developers to build applications and services that use it as a data-store and allow users to switch between any application or service without loosing their data.

@danparsons
danparsons / gist:3195652
Created July 29, 2012 01:46
How to stream the London 2012 Olympics

How to stream the London 2012 Olympics

There have been several HOWTOs posted regarding streaming the 2012 Olympics using HTTP / SOCKS proxies via SSH and other similar methods. None of these actually work using the latest Flash on Mountain Lion (with Firefox, Chrome or Safari). Additionally, the third-party streaming sites don't provide BBC's amazing interface, which lets you quickly skip to individual competitors and events. However, setting up an OpenVPN server does work, with some tweaks. You'll get the exact same UX that people in England receive.

@jimeh
jimeh / decode.rb
Created August 20, 2011 13:56
Ruby-based Benchmark of MessagePack vs. JSON & Yajl
# encoding: utf-8
require 'bench_press'
require 'json'
require 'yajl'
require 'msgpack'
extend BenchPress
reps 10_000
@eculver
eculver / recursive remove .AppleDouble directories
Created May 26, 2011 00:03
recursive remove .AppleDouble directories
find . -name \.AppleDouble -exec rm -rf {} \;
@rcambrj
rcambrj / office365-owa-fluid-notifications.js
Last active May 8, 2017 14:54
Userscript for desktop notifications for outlook.office365.com in a Fluid App (SSB)
// native notifications for https://outlook.office365.com/
(function () {
var logging = false;
var bound = [];
function log () {
return logging && console.log.apply(console, ['notifications:'].concat(Array.prototype.slice.apply(arguments)));
}
@rcambrj
rcambrj / office365-owa-fluid-badge.js
Last active May 8, 2017 14:54 — forked from kmwallio/outlook-fluid.js
Userscript for badge icon for outlook.office365.com in a Fluid App (SSB).
// use for patterns:
// https://login.microsoftonline.com/*
// https://outlook.office365.com/*
// desktop badge count for https://outlook.office365.com/
(function () {
var logging = false;
function log () {
@vmg
vmg / sparc.c
Created November 15, 2011 23:03
Sparks in C
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
int main
(int argc
,char *ac []){int i, count = argc - 1;
double * dvalues=malloc(01- 01+count*
sizeof(double)+1); double mi=DBL_MAX,ran=.0,ma =DBL_MIN,mo;for(i= 00; argc>1
&&i<count;i=i+8-7) {double val = atof(ac[i+1]) ;if(23&&val<mi)mi= val;if(val
@lkraider
lkraider / adf2mp3.py
Created November 2, 2011 22:40
GTA Vice City ADF to MP3 audio converter
#!/usr/bin/env python
import sys
import os
def adf2mp3(input_path, output_path, buffer_size=1024*1024):
print 'Converting', output_path
input_file = open(input_path, 'rb')
output_file = open(output_path, 'wb')
for read_buffer in iter(lambda: input_file.read(buffer_size), ''):
@legumbre
legumbre / foo.md
Created June 29, 2012 00:14
resolving merge conflicts with magit-ediff

Use magit-ediff to resolve merge conflicts

Use magit-ediff or 'e' on an unmerged item to resolve merge conflicts with ediff. Magit will set up an ediff with three buffers A, B and C. A and B are the original (conflicting) files, and C is the conflicted merge.

Use 'n'/'p' to move to the next/previous conflict, use 'a'/'b' to choose which changes (those in a A or B) should be the ones to keep in the merged file.

You can always just switch to buffer C and edit what the merged version should look like.

@dustinmm80
dustinmm80 / multivm_vagrant_dry.md
Created September 15, 2013 04:48
An example of how to write Vagrantfiles following the DRY principle.
=begin
Example box JSON schema
{
    :name => :name_of_vagrant_box, #REQUIRED
    :ip => '10.0.0.11', #REQUIRED
    :synced_folders => [
        { '.' => '/home/vagrant/myapp' }
    ],
    :commands => [