Skip to content

Instantly share code, notes, and snippets.

@jeffdevine
jeffdevine / good_luck.rb
Last active March 9, 2023 19:31
Friday Deploy for Capistrano 2.x
before 'deploy', 'deploy:good_luck'
before 'deploy:migration', 'deploy:good_luck'
task :good_luck, roles: :app, except: { no_release: true } do
if Time.now.wday == 5
logger.debug('')
logger.debug('┓┏┓┏┓┃')
logger.debug('┛┗┛┗┛┃\○/')
logger.debug('┓┏┓┏┓┃ / Friday')
logger.debug('┛┗┛┗┛┃ノ)')
# This simplest thing is to clone Jim's repo (https://github.com/jimweirich/gilded_rose_kata) and then
# put this file in the root directory.
gem 'minitest', '~> 4.7'
require "minitest/autorun"
require "minitest/reporters"
MiniTest::Reporters.use! MiniTest::Reporters::SpecReporter.new
require_relative './gilded_rose'
@namuol
namuol / INSTALL.md
Last active July 24, 2023 11:53
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
@runlevel5
runlevel5 / how_to_install_ruby_193-p392_on_osx_10_8.md
Last active January 23, 2019 22:51
How to install Ruby 1.9.3-p392 on OSX 10.8+

How to install Ruby 1.9.3-p392 on Mac OSX 10.8+

RVM:

rvm get stable && rvm reload

Firstly, the OpenSSL comes with your OSX 10.8+ is outdated, you need to get latest version

anonymous
anonymous / gist:4434144
Created January 2, 2013 12:13
Install debugger dependency -- adjust ruby version
gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p327/
@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@guillermo
guillermo / copy_dotfiles
Created May 8, 2012 09:55
Copy dot files in a faster way than scp
#!/bin/sh
#
# Usage
# copy_dotfiles user@machine
#
FILES=".vim .vimrc .inputrc .gitconfig"
cd $HOME
tar cL $FILES | ssh -C $1 'tar vx'
@gasman
gasman / pnginator.rb
Created April 30, 2012 18:08
pnginator: pack Javascript into a self-extracting PNG
#!/usr/bin/env ruby -w
# pnginator.rb: pack a .js file into a PNG image with an HTML payload;
# when saved with an .html extension and opened in a browser, the HTML extracts and executes
# the javascript.
# Usage: ruby pnginator.rb input.js output.png.html
# By Gasman <http://matt.west.co.tt/>
# from an original idea by Daeken: http://daeken.com/superpacking-js-demos
@mrsimo
mrsimo / hack.sh
Created April 4, 2012 08:34 — forked from erikh/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/2299719/hack.sh | sh
#