Skip to content

Instantly share code, notes, and snippets.

View Rud5G's full-sized avatar
🏡
Working remotely

Rudger Rud5G

🏡
Working remotely
View GitHub Profile
@tobias
tobias / run_tags.rb
Created January 1, 2009 16:44
A script for generating TAGS from a git hook.
#!/usr/bin/ruby
#-*-ruby-*-
# A script to run ctags on all .rb files in a project. Can be run on
# the current dir, called from a git callback, or install itself as a
# git post-merge and post-commit callback.
CTAGS = '/opt/local/bin/ctags'
HOOKS = %w{ post-merge post-commit post-checkout }
HOOKS_DIR = '.git/hooks'
@jwage
jwage / SplClassLoader.php
Last active April 9, 2024 21:04
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active May 16, 2024 16:51
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@medmunds
medmunds / knockout-jquery-ui-widget.js
Created March 27, 2011 17:35
Knockout binding for jQuery.ui.widget
// knockout-jquery-ui-widget.js
// Copyright (c) 2011, Planapple, Inc.
// License: MIT (http://www.opensource.org/licenses/mit-license.php)
//
// Knockout binding for jQuery UI widgets
//
// Examples:
// <input type="submit" value="OK" data-bind='jqueryui: "button"' />
//
// Attaches a jQuery UI button widget to this button, with default options.
@jehiah
jehiah / git-branch-status
Last active March 21, 2024 12:39
show git ahead/behind info for branches
moved to github --> https://github.com/bill-auger/git-branch-status/
@Rud5G
Rud5G / vimrc.vim
Last active September 28, 2020 22:21
dotfile: .vimrc
"
" https://gist.github.com/Rud5G/2316255
"
" mkdir -p ~/.vim/{backup,syntax,tmp}
"
set autoindent " lines following an indented line will have the same indentation as the previous line.
set expandtab " resplace tabs with actuall spaces
set shiftwidth=4 " softtabs width 4.
set tabstop=4 " tabs are 4 spaces
@calavera
calavera / gist:2579422
Created May 2, 2012 19:16
minitest-chef-handler recipe
gem_package "minitest" do
action :nothing
end.run_action(:upgrade)
gem_package "minitest-chef-handler" do
action :nothing
end.run_action(:upgrade)
require 'rubygems'
Gem.clear_paths
@miah
miah / gist:2705827
Created May 15, 2012 23:02
BDD Cookbook Writing
# After approximately 3 hours of discussion we have come up with the following:
- Integration testing with Minitest
- Functional testing with ChefSpec
- Because Minitest runs after convergence, it becomes time consuming to test during cookbook development.
- Testing with ChefSpec during development helps ensure your cookbook meets functional requirements.
@danielsdeleo
danielsdeleo / gist:2920702
Created June 12, 2012 23:06
Eval and Converge a Single Chef Recipe
#!/usr/bin/env ruby
recipe_path = ARGV[0]
if recipe_path.nil?
STDERR.puts "usage: chef-apply RECIPE_FILE"
exit 1
end
recipe_path = File.expand_path(recipe_path)
@Rud5G
Rud5G / ll.sh
Last active May 10, 2021 12:55
unalias ll
#!/usr/bin/env bash
clear
# https://gist.github.com/Rud5G/2947522
if [ ! -z "$1" ]
then
dir="$1"
else
dir="."