Skip to content

Instantly share code, notes, and snippets.

@ream88
ream88 / executeios.js
Last active January 4, 2016 11:19
Node.js script to download the https://executeios.com videos
// npm install superagent jsdom jquery
var https = require('superagent'),
exec = require('child_process').exec
https.get('https://executeios.com/receipt/<yourid>', function(res) {
var window = require('jsdom').jsdom(res.text).createWindow()
var $ = require('jquery')(window)
var videos = []
@ream88
ream88 / gist:5198683
Created March 19, 2013 18:20
Resize images without interpolation is really simple
convert small.jpg -scale 5000% big.jpg
@ream88
ream88 / git_fix.rb
Last active December 13, 2015 23:59 — forked from Deradon/git_fix.rb
#!/usr/bin/env ruby
# Author: Patrick Helm ([email protected]), 2013
#
#
# Simple git-snippet to commit a small fix with auto-generated commit-message.
#
# ## Description
#
# I noticed, we developers often needs to fix a small typo or do something
// Inside my base include file which includes Compass.
%bs-border-box { @include box-sizing(border-box); }
// Inside my application Sass file.
@each $el in elements-of-type('block') { #{$el} { @extend %bs-border-box; } }
[class^="icon-"],
[class*=" icon-"] {
font-family: inherit;
&:before {
font-family: FontAwesome;
}
}
@ream88
ream88 / gitrm.rb
Created January 16, 2013 11:04
Merge two diverged branches. `git status --porcelain|ruby gitrm.rb`
ARGF.each_line do |line|
action, file = line.split
Kernel.system "git rm -f #{file}" if %w[A DU].include?(action)
end
@ream88
ream88 / Gemfile
Created August 27, 2012 10:39
Sprockets/Asset Pipeline in every project
source :rubygems
gem 'actionpack', '~> 3.2', require: 'sprockets/static_compiler'
gem 'filewatcher'
gem 'rake'
gem 'sprockets'
gem 'coffee-script'
gem 'sass'
gem 'uglifier'
@ream88
ream88 / response_matchers.rb
Created July 21, 2012 10:16
minitest-matchers for controller/functional specs
# Simple minitest matchers which will make your controller/functional specs less pain in the ass.
#
# ==== Dependencies
#
# gem 'minitest'
# gem 'minitest-matchers'
#
# ==== Matchers
#
# +must_have_status+ and its opposite +wont_have_status+ take both one argument which must be one of the following:
@ream88
ream88 / Rakefile
Created July 18, 2012 11:24
Minitest rake task
require 'rake'
require 'rake/testtask'
Rake::TestTask.new do |t|
t.test_files = Dir.glob('spec/**/*_spec.rb')
end
task(default: :test)
@ream88
ream88 / retina-background-image.scss
Last active October 7, 2015 00:17
@mixin retina-background-image #snippet
// Helps you to provide provide retina optimized backgrounds
// in an innovative and easy way. (Requires compass).
//
// ==== Options
// * <tt>$url</tt> is your background image.
// * <tt>$retina_url</tt> is your retina optimized background image.
// If no $retina_url option is provided or it equals to `false`, $url
// is used for the retina background image, but its size it cut to half.
//
// ==== Examples