Skip to content

Instantly share code, notes, and snippets.

View bjeanes's full-sized avatar
🕊️

Bo Jeanes bjeanes

🕊️
View GitHub Profile
@justjkk
justjkk / LICENSE
Last active April 7, 2024 16:57
Parsing JSON with lex and yacc
The MIT License (MIT)
Copyright (c) 2015 J Kishore Kumar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
sudo bash
cd "/Library/Application Support/VMware Fusion/isoimages"
mkdir original
mv darwin.iso tools-key.pub *.sig original
perl -n -p -e 's/ServerVersion.plist/SystemVersion.plist/g' < original/darwin.iso > darwin.iso
openssl genrsa -out tools-priv.pem 2048
openssl rsa -in tools-priv.pem -pubout -out tools-key.pub
openssl dgst -sha1 -sign tools-priv.pem < darwin.iso > darwin.iso.sig
for A in *.iso ; do openssl dgst -sha1 -sign tools-priv.pem < $A > $A.sig ; done
@isaacs
isaacs / color-test.sh
Created November 7, 2010 20:35
test your terminal's colors.
#!/bin/bash
#
# This file echoes a bunch of color codes to the
# terminal to demonstrate what's available. Each
# line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a
# test use of that color on all nine background
# colors (default + 8 escapes).
#
@lenary
lenary / gitconfig.ini
Created February 18, 2011 01:21
a special excerpt of my gitconfig
$ git clone github:lenary/guides.git
Cloning into guides...
remote: Counting objects: 255, done.
remote: Compressing objects: 100% (216/216), done.
remote: Total 255 (delta 111), reused 163 (delta 35)
Receiving objects: 100% (255/255), 1.49 MiB | 564 KiB/s, done.
Resolving deltas: 100% (111/111), done.
$ cd guides
$ git remote -v
@andyl
andyl / ctags_vim_paths_gemfile.rb
Created February 18, 2011 19:08
Generates Ctags and Vim Paths from Gemfile.lock
#!/usr/bin/ruby
require 'rubygems'
require 'bundler'
=begin
This script was written to incorporate Bundler and Gemfile.lock into
Vim's tag and file-finding tools.
=end
# This code generates ctags. If a Gemfile.lock is found
@mads-hartmann
mads-hartmann / Coffeescript ctags
Created April 7, 2011 07:44
ctags definitions for Coffeescript. Very basic for now. "> ctags -e -R source_folder" and then M-. to jump to the definition of any function or variable (if you're using emacs)
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=.*->.*$/\1/f,function/
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=[^->\n]*$/\1/v,variable/
@rmoriz
rmoriz / Gemfile
Last active February 7, 2020 12:30
UUID primary keys in Rails 3
# Gemfile
gem 'uuidtools'
@lfborjas
lfborjas / show.py
Created April 28, 2011 02:40
Tunnel a local port to a remote host (like showoff.io does)
#!/usr/bin/python
#usage python show.py <local_port>
'''
Taken from: https://gist.github.com/932137 (found in http://news.ycombinator.com/item?id=2467107 )
Let's say you have a webapp running in localhost (with `manage.py runserver` in django or `ruby script.rb` in sinatra or `rails server` or whatever) and you want others to be able to see it with a public url without deploying remotely.
ssh provides a neat facility for that: tunneling. You set up a "tunnel" from the remote host to yours and vice-versa and then you give the remote host's url and it will send all of its requests to your local daemon.
@somebox
somebox / backbone.rails.js
Created June 30, 2011 10:42 — forked from trydionel/backbone.rails.js
Makes Backbone.js with Rails+CSRF
//
// Backbone.Rails.js
//
// Makes Backbone.js play nicely with the default Rails setup, i.e.,
// no need to set
// ActiveRecord::Base.include_root_in_json = false
// and build all of your models directly from `params` rather than
// `params[:model]`.
//
// Load this file after backbone.js and before your application JS.
@searls
searls / cash-register-problem.md
Created September 7, 2011 23:08
Cash Register Kata

Cash Register Problem

A cash register has a drawer with separate bins for eight different denominations of money:

  • Pennies
  • Nickels
  • Dimes
  • Quarters
  • Singles
  • Fives