Skip to content

Instantly share code, notes, and snippets.

View mattscilipoti's full-sized avatar

Matt Scilipoti mattscilipoti

View GitHub Profile
@mattscilipoti
mattscilipoti / .powenv
Last active January 18, 2021 22:09 — forked from flarik/dot.powrc.sh
Pow's .powenv config file for use with RVM's config files .rvmrc or .ruby-version (+ optional .ruby-gemset)
#!/usr/bin/env bash
if [ -f "${rvm_path}/scripts/rvm" ]; then
source "${rvm_path}/scripts/rvm"
# use the config files
# .rvmrc supersedes all others
if [ -f ".rvmrc" ]; then
source ".rvmrc"
@mattscilipoti
mattscilipoti / rspec_cheat_sheet.rd
Last active August 29, 2015 14:26 — forked from byplayer/rspec_cheat_sheet.rd
rspec cheat sheet
INSTALL
=======
$ gem install rspec
RSPEC-RAILS
===========
RAILS-3
=======
@mattscilipoti
mattscilipoti / pre-push.sh
Last active January 3, 2016 06:39 — forked from pixelhandler/pre-push.sh
pre-push script: Protects some branches from destructive actions.
#!/usr/bin/env ruby
# NOTE! this is a work in progress. This is not tested or used regularly.
# Ensures we do not call destructive commands on protected branches.
#
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# = Capistrano database.yml task
#
# Provides a couple of tasks for creating the database.yml
# configuration file dynamically when deploy:setup is run.
#
# Category:: Capistrano
# Package:: Database
# Author:: Simone Carletti <weppos@weppos.net>
# Copyright:: 2007-2009 The Authors
#!/usr/bin/ruby
#
# I deliberately didn't DRY /usr/local references into a variable as this
# script will not "just work" if you change the destination directory. However
# please feel free to fork it and make that possible.
#
# If you do fork, please ensure you add a comment here that explains what the
# changes are intended to do and how well you tested them.
#
# 30th March 2010:
@mattscilipoti
mattscilipoti / log.rb
Created January 28, 2010 17:00 — forked from canadaduane/log.rb
log in json format
require 'json'
$log_filename ||= File.expand_path(File.join("..", "ruby.log.json"), File.dirname(__FILE__))
begin
if !File.exist?($log_filename)
File.open($log_filename, "w") do |f|
f.write "["
end
end
We couldn’t find that file to show.