Skip to content

Instantly share code, notes, and snippets.

@bkeating
bkeating / howto-filemerge-git-osx.md
Created March 11, 2010 21:36
HOWTO: Using FileMerge (opendiff) with Git on OSX

HOWTO: Using FileMerge (opendiff) with Git on OSX

FileMerge (opendiff) can really come in handy when you need to visually compare merging conflicts. Other times it's just a nice visual way to review your days work.

The following method works by creating a simple bash script (git-diff-cmd.sh) that sets us up with the proper command line arguments for Git to pass off files to FileMerge.

@SchizoDuckie
SchizoDuckie / apf_release.prepend.js
Created March 20, 2012 20:19
Cloud9 IDE Touch Enabler Monkeypatch
/**
* A proof of concept monkeypatch to make Cloud9 IDE work on a tablet.
* Since i'm an extremely lazy bastard I prepended this snippet directly in package/client/js/apf_release.js
*
* What does it do?
* - It fires a doubleclick for a 2-finger tap
* - It fires a mousewheel up / down event for a 2-finger swipe up / down.
*
* How does it work?
* Prepend the functions below to <cloud9>/package/client/js/apf_release.js, save, load in tablet.
@ivanzoid
ivanzoid / setupGOROOT.sh
Created August 26, 2012 10:43
Aumatically setup $GOROOT in HomeBrew
#
# Place this code to your .profile, .bashrc, .bash_profile or whatever
#
program_exists () {
type "$1" &> /dev/null ;
}
if program_exists go; then
@clintongormley
clintongormley / gist:4095280
Created November 17, 2012 12:00
Using synonyms in Elasticsearch

We create an index with:

  • two filters: synonyms_expand and synonyms_contract
  • two analyzers: synonyms_expand and synonyms_contract
  • three text fields:
    • text_1 uses the synonyms_expand analyzer at index and search time
    • text_2 uses the synonyms_expand analyzer at index time, but the standard analyzer at search time
    • text_3 uses the synonyms_contract analyzer at index and search time

.

module Ratis
class RoutePattern
attr_accessor :description, :area, :lat, :long, :point, :atisstopid, :stopid
def self.where(conditions)
#just trying to find by date for now. once this works, will add servicetype condition
date = conditions.delete(:date).to_s.upcase
@johntyree
johntyree / dualscreen.sh
Created March 14, 2013 17:51
Easy xRandr settings.
#!/bin/sh
# GistID: 5163520
usage () {
echo "Usage: $0 OPTION
Change multi-head display settings.
Options:
-a Do something reasonable
-0 Laptop
-1 Laptop + VGA
@aklowther
aklowther / Log Define
Last active December 16, 2015 08:19
Replace NSLog for more info to where the printout is. Add to project .pch file to use in the whole project w/o needed imports
#ifdef DEBUG
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
# define DLog(...)
#endif
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#ifdef DEBUG
# define ULog(fmt, ...) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"%s\n [Line %d] ", __PRETTY_FUNCTION__, __LINE__] message:[NSString stringWithFormat:fmt, ##__VA_ARGS__] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; }
#else
# define ULog(...)
#!/usr/bin/env python3
# coding: utf-8
# GistID: 7799767
from __future__ import print_function
# import cStringIO
import itertools
import os
import re
@scascketta
scascketta / 11106@2015-01-20T14:57:00-06:00<---->2015-01-20T15:31:00-06:00.geojson
Last active August 29, 2015 14:13
Recorded location of three CapMetro vehicles on 01/20/15. Click on an individual marker to see the time at that position.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@liviu-
liviu- / tota11y.user.js
Last active August 29, 2015 14:23
tota11y userscript
// ==UserScript==
// @name Tota11y userscript
// @namespace https://khan.github.io/tota11y/
// @description Tota11y userscript version
// @version 1
// @match *://*/*
// @require https://khan.github.io/tota11y/tota11y/build/tota11y.min.js
// @grant none
// ==/UserScript==