Skip to content

Instantly share code, notes, and snippets.

View joshuapinter's full-sized avatar
🎯
Focusing

Joshua Pinter joshuapinter

🎯
Focusing
View GitHub Profile
set :application, "application"
set :deploy_to, "/var/www/application"
set :deploy_via, "remote_cache"
set :scm, :subversion
set :repository, "http://account.svn.beanstalkapp.com/repository/trunk"
set :scm_user, "deploy_dummy"
set :scm_password, File.read("#{ENV['HOME']}/.application_deployment_password").strip
@chuckbergeron
chuckbergeron / external_resource.rb
Created November 24, 2011 18:18
ExternalResource
module ExternalResource
# TODO: handle: Timeout::Error (time's up!):
# Requires a block with the HTTPClient.get call or what-have-you
# see InvitationRequestsController for details
def self.load( name = "" )
retries = 12
total = retries
@bendyorke
bendyorke / benchmark.rb
Created May 20, 2014 06:54
Benchmarking sampling of a hash
require "benchmark"
n = 10000
arr = (1..1000).to_a
zip = arr.zip arr
hash = Hash[zip]
Benchmark.bm do |x|
x.report("%-30s" %["sampling array"]) { n.times do
arr.sample
@caleb531
caleb531 / snap-to-grid.js
Last active May 21, 2018 08:37
Makes a jCanvas layer draggable along a defined grid
// Available in jCanvas v20.1.0
// The pixel multiple to snap to
var snapToAmount = 40;
// Round the given value to the nearest multiple of n
function nearest(value, n) {
return Math.round(value / n) * n;
}
$('canvas').drawArc({
layer: true,
@akabab
akabab / rm_mysql.md
Last active November 14, 2018 20:26 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

@honorlin
honorlin / gist:b34d1bba6514d74c24cf
Created August 8, 2015 10:37
Ubuntu Install Lastest ImageMagick-6.9.1-10
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
curl -O http://www.imagemagick.org/download/ImageMagick-6.9.1-10.tar.gz
tar xzvf ImageMagick-6.9.1-10.tar.gz
cd ImageMagick-6.9.1-10/
./configure --prefix=/opt/imagemagick-6.9.1-10 && make
checkinstall
@daronco
daronco / have_attr_accessor.rb
Created November 23, 2012 00:13
Shoulda matcher have_attr_accessor
# Ensures the model has an attr_accessor, attr_reader or attr_writer
# Examples:
# it { should have_attr_accessor(:value) }
# it { should have_attr_accessor(:value).read_only }
# it { should have_attr_accessor(:value).write_only }
module Shoulda
module Matchers
module ActiveModel # :nodoc
def have_attr_accessor(attribute)
@joshuapinter
joshuapinter / .npmrc
Created March 14, 2019 17:01
Common Configuration Files
save-exact = true # Saves exact version without needing --save-exact.
@burnash
burnash / imagemagick-install-steps
Last active March 27, 2019 12:00 — forked from rodleviton/imagemagick-install-steps
Installing Image Magick on Ubuntu 14.04
sudo -i
cd
apt-get install build-essential checkinstall -y
apt-get build-dep imagemagick -y
apt-get install libwebp-dev -y
wget http://www.imagemagick.org/download/ImageMagick-6.9.5-8.tar.gz
tar xzvf ImageMagick-6.9.5-8.tar.gz
cd ImageMagick-6.9.5-8/
./configure
make
@wvteijlingen
wvteijlingen / index.js
Last active July 20, 2019 12:36
HOC for react-navigation that maps params to props
import paramsToProps from 'paramsToProps.js'
const MainNavigator = StackNavigator({
firstScreen: { screen: paramsToProps(FirstScreenComponent) },
secondScreen: { screen: paramsToProps(SecondScreenComponent) },
});