Skip to content

Instantly share code, notes, and snippets.

@woodie
woodie / README.rdoc
Created March 17, 2010 08:35
Rails 3 on App Engine

Rails 3.0.pre on App Engine

You can Rails 3 on App Engine, but it won’t be especially useful until bundler 10. You should try these instead:

Install the Development Environment

The gems for the development environment include a pre-release appengine-tools gem that provides a pre-release version of jruby-rack.

@nicoulaj
nicoulaj / build-zsh.sh
Created November 25, 2010 20:19
Build Zsh from sources on Ubuntu
#!/bin/sh​
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo
git clone git://zsh.git.sf.net/gitroot/zsh/zsh
cd zsh
@bootleq
bootleq / gist:738007
Created December 12, 2010 12:29
[vimrc] ShowMarks and wokmarks.vim
" }}}2 ShowMarks {{{2
let g:showmarks_include='abcdefghijklmnopqrstuvwxyz' . 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
let g:showmarks_ignore_type=""
let g:showmarks_textlower="\t"
let g:showmarks_textupper="\t"
let g:showmarks_textother="\t"
let g:showmarks_auto_toggle = 0
nnoremap <silent> mo :ShowMarksOn<CR>
nnoremap <silent> mt :ShowMarksToggle<CR>
@boj
boj / score.rb
Created February 22, 2011 10:18
MongoMapper MapReduce Example
class Score
include MongoMapper::Document
key :user_id, ObjectId, :index => true
key :stage, String, :index => true
key :score, Integer
timestamps!
def self.high_score_map
<<-MAP
@tobin
tobin / hk.c
Last active September 10, 2022 21:53
Hoshen-Kopelman algorithm for cluster labeling
/* Tobin Fricke's implementation of the
Hoshen-Kopelman algorithm for
cluster labeling.
Copyright (c) September 9, 2000, by Tobin Fricke <fricke@gmail.com>
Modified 2002-03-09 Tobin Fricke
Modified substantially 2004-04-21 by Tobin Fricke
This program is written in the 1999 standard of the C language (C99). Older C
@mhayes
mhayes / gist:984326
Created May 21, 2011 07:14 — forked from kirs/gist:984320
broken rakefile
require File.expand_path('../config/application', __FILE__)
require 'rake'
module ::Dpp
class Application
include Rake::DSL
end
end
module ::RakeFileUtils
@sjl
sjl / gist:1240857
Created September 25, 2011 17:16
Snow Leopard-compiled DVTM binaries (for Lion users)
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@rcknr
rcknr / DriveUpload.gs
Last active February 15, 2023 20:06
This is a sample code to upload a PDF file to Google Drive with OCR in Apps Script. uploadPdfOcr function returns a File object. To run the code provide a developer key for an API Console project with Drive API service enabled.
function uploadPdfOcr() {
authorize();
var key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // <-- developer key
var file = UrlFetchApp.fetch("http://somewhere.com/path/file.pdf").getBlob();
var metadata = { title: file.getName() }
var params = {method:"post",
oAuthServiceName: "drive",
oAuthUseToken: "always",
contentType: "application/pdf",
contentLength: file.getBytes().length,
@katowulf
katowulf / app.js
Last active February 24, 2022 06:51
Simple paginate example in AngularFire with Firebase.util (http://firebase.github.io/firebase-util/)
var app = angular.module('app', ['firebase']);
app.controller('ctrl', function($scope, $pageArray) {
$scope.pageItems = $pageArray(ref, 'number');
});
app.factory('$pageArray', function($firebaseArray) {
return function(ref, field) {
// create a Paginate reference
var pageRef = new Firebase.util.Paginate(ref, field, {maxCacheSize: 250});