Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 15, 2024 09:51
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@obie
obie / gist:1886393
Created February 22, 2012 18:08
Example of using an anonymous class to build an RSpec custom Matcher
def be_guest_member_of(expected)
Class.new do
def initialize(expected)
@expected = expected
end
def matches?(target)
@target = target
@target.memberships.where(role: "guest").map(&:network).include? @expected
end
@vjt
vjt / 1-session.sh
Last active June 5, 2018 12:31
vjt's tmux RVM + ViM IDE setup
#!/bin/sh
#
# IDE Session starter - you should save this script as ~/bin/session, make it
# executable with chmod +x ~/bin/session, and then make a symlink to it for
# every application you want to start.
# E.g. ln -s session ~/bin/members creates a "members" symlink, and when you'll issue
# "members" on the command line this script will:
# Check if a tmux session named "members" exists
@cavalle
cavalle / feature.rb
Created November 7, 2011 16:22
Meatloaf (Just another scam)
require 'meatloaf'
require 'steps'
Feature "Eat candies" do
Scenario "Eat a candy from a jar full of them" do
Given "I have a jar with candies", candies: 10
When "I eat one candy"
Then "the jar won't be empty"
end
@Shilo
Shilo / SPTexture+Additions.h
Created October 17, 2011 07:43
A SPTexture category for Sparrow that will replace or remove colors.
//
// SPTexture+Additions.h
// Sparrow
//
// Created by Shilo White on 10/15/11.
// Copyright 2011 Shilocity Productions. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "SPTexture.h"
@raul
raul / retry_upto.rb
Created October 7, 2011 06:42
retry_upto.rb
# Ruby `retry` with steroids:
#
# - retry up to 5 times without waiting between them and retrying after any exception
#
# retry_upto(5) do ... end
#
# - retry up to 5 times, waiting 2 seconds between retries
#
# retry_upto(5, :wait => 2) do ... end
#
@sirupsen
sirupsen / vim7.3_mac_install.rb
Created July 27, 2011 21:57 — forked from pengwynn/vim7.3_mac_install.rb
Script to install Vim 7.3 with ruby support for Mac OS X Lion
# requires root permissions in /usr/bin/
star = String.new
8.times { star += "*" }
Star = "\n#{star * 3}\n"
def newblock string
puts "\n#{Star}#{string}#{Star}\n"
end
@fguillen
fguillen / git_tips.md
Created December 19, 2010 20:53
Git Tips

(Several of these git examples have been extracted from the book 'Pragmatic guide to GIT' of Travis Swicegood )

Git tips

Global git user

git config --global user.name "Fernando Guillen"
git config --global user.email "[email protected]"

Repository git user

cd /develop/myrepo

# in reply to http://groups.google.com/group/openwferu-users/browse_frm/thread/96354a232e2cad8e
# let's assume the engine is accessible via the 'engine' variable and
# that the process instance id (wfid) is '20090119-biropoheku'
process_status = engine.processes_status('20090119-biropoheku')
sequence_expression = process_status.all_expressions.find { |fexp|
fexp.fei.expid == '0.0'
# or