Skip to content

Instantly share code, notes, and snippets.

@sjl
sjl / next_motion_mapping.vim
Created August 25, 2011 19:43 — forked from AndrewRadev/LICENSE
Execute a vim motion on the "next" text object
" Motion for "next/last object". For example, "din(" would go to the next "()" pair
" and delete its contents.
onoremap an :<c-u>call <SID>NextTextObject('a', 'f')<cr>
xnoremap an :<c-u>call <SID>NextTextObject('a', 'f')<cr>
onoremap in :<c-u>call <SID>NextTextObject('i', 'f')<cr>
xnoremap in :<c-u>call <SID>NextTextObject('i', 'f')<cr>
onoremap al :<c-u>call <SID>NextTextObject('a', 'F')<cr>
xnoremap al :<c-u>call <SID>NextTextObject('a', 'F')<cr>
@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created February 12, 2012 20:40
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 17, 2024 01:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
= intro
- what is sinatra
- history
- about this book
-- books history
-- contributing
-- getting help
- getting started
-- installation
-- hello world
@rweald
rweald / ParseJsonExampleJob.scala
Created December 19, 2012 01:37
Sample scalding job that reads a line of JSON and parses out 1 field
import com.twitter.scalding._
import scala.util.parsing.json._
class ParseJsonJob(args: Args) extends Job(args) {
TextLine(args("input"))
.map(('line) -> ('parseStatus, 'uri)) {
line: String => {
JSON.parseFull(line) match {
case Some(data: Map[String, String]) => ("success", data("uri"))
case None => ("failed", "")
guard 'bundler' do
watch('Gemfile')
end
guard 'livereload' do
watch(%r{app/views/.+\.(erb|haml|md|builder|jbuilder)})
watch(%r{app/helpers/.+\.rb})
watch(%r{public/.+\.(css|js|html)})
watch(%r{config/locales/.+\.yml})
watch(%r{(app|vendor)/assets/\w+/(.+\.(css|js|html)).*}) { |m| "/assets/#{m[2]}" }
@azymnis
azymnis / ItemSimilarity.scala
Created December 13, 2013 05:17
Approximate item similarity using LSH in Scalding.
import com.twitter.scalding._
import com.twitter.algebird.{ MinHasher, MinHasher32, MinHashSignature }
/**
* Computes similar items (with a string itemId), based on approximate
* Jaccard similarity, using LSH.
*
* Assumes an input data TSV file of the following format:
*
* itemId userId
@baroquebobcat
baroquebobcat / symbol_curry.rb
Last active December 31, 2015 18:49
Symbol#curry, because one kind of curry just isn't enough
# add a curry method to symbol for evil/awesome symbol to proc powers.
class Symbol
def curry(n=nil)
->(*args) {
->(obj) {obj.send self, *args}
}.curry(n)
end
def call(*n)
curry.(*n)
@cschneid
cschneid / README.md
Last active January 2, 2016 17:29
Quick Outline of QT + Haskell Group Project for Boulder Haskell Group

What this is

The Boulder Haskell Group is going to start working on a shared project to enhance the HSQML library on Hackage, which binds to the QT library for cross-platform GUI development.

This doc is a braindump currently. Please send pull requests w/ any more found out information as we go. It will probably be edited down and become a real README at somepoint for our new project.

URLs

QT: http://qt-project.org/

@reinh
reinh / Average.lhs
Last active January 4, 2016 07:18
Average Semigroup
=================
> {-# LANGUAGE GeneralizedNewtypeDeriving #-}
>
> module Average where
>
> import Data.Semigroup
> import Data.Ratio (Ratio, (%))