Skip to content

Instantly share code, notes, and snippets.

build_package_patched() {
# These three patches are included when RVM builds REE
cd source
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/tcmalloc.patch'
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/stdout-rouge-fix.patch'
# already applied?!: wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/no_sslv2.diff'
patch -p1 < tcmalloc.patch
patch -p1 < stdout-rouge-fix.patch
# patch -p1 < no_sslv2.diff
cd ..
@brandonaaron
brandonaaron / out.css
Last active August 27, 2018 16:47
uncss #385 example
I'm in your CSS
/*** uncss> filename: test.css ***/
/*! minireset.css v0.0.3 | MIT License | github.com/jgthms/minireset.css */
html,
body,
h1 {
margin: 0;
padding: 0;
}

Keybase proof

I hereby claim:

  • I am brandonaaron on github.
  • I am brandonaaron (https://keybase.io/brandonaaron) on keybase.
  • I have a public key ASDXGb9S8_c33AFIcYqozrZaIGLLg4JULCdzzs8_SAoCUAo

To claim this, I am signing this object:

@brandonaaron
brandonaaron / metatags.html
Last active May 10, 2019 03:49
Home Screen Icons for Web Sites/Apps
<!-- iOS -->
<link rel="apple-touch-icon" href="touch-icon-iphone.png"> <!-- 60x60 -->
<link rel="apple-touch-icon" sizes="76x76" href="touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="120x120" href="touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="152x152" href="touch-icon-ipad-retina.png">
<!-- Windows 8 Pinning -->
<meta name="msapplication-TileImage" content="/metro-tile.png"> <!-- 144x144 -->
<meta name="msapplication-TileColor" content="#015565">
@brandonaaron
brandonaaron / gist:2577317
Created May 2, 2012 15:09
Support AMD in jQuery plugins
;(function() {
function setup($) {
// setup plugin
}
if (typeof define === "function" && define.amd && define.amd.jQuery) {
define(['jquery'], setup);
} else {
setup(jQuery);
@brandonaaron
brandonaaron / recursive_partition.rb
Created August 23, 2011 14:30
A recursive partition method for Ruby's String.
class String
def recursive_partition(sep)
result = self.partition(sep)
if sep != "" && result[2].match(sep)
extra = result.pop
result << extra.recursive_partition(sep)
end
result.flatten
end
end
require 'lib/jsmin'
# override the write_asset_file_contents so that it will minify js in production via jsmin.rb
module ActionView
module Helpers
module AssetTagHelper
alias_method :write_asset_file_contents_stock, :write_asset_file_contents
def write_asset_file_contents(joined_asset_path, asset_paths)
ret = write_asset_file_contents_stock(joined_asset_path, asset_paths)
Object.defineProperty(Object.prototype, "extend", {value: function (obj) {
obj.__proto__ = this;
return obj;
}});
Object.defineProperty(Object.prototype, "new", {value: function () {
var obj = Object.create(this);
if (obj.initialize) obj.initialize.apply(obj, arguments);
return obj;
}});
var model = Object.create(Model);
model.create([{...},{...}]);
model.update({...});
model.get(id);
model.getAll();
model.size();
model.destroy(id);
model.destroyAll();
model.find({ foo: 'bar' });
model.find(finderFn(row) {...});
# override the write_asset_file_contents so that it will minify js in production via jsmin.rb
module ActionView
module Helpers
module AssetTagHelper
alias_method :write_asset_file_contents_stock, :write_asset_file_contents
def write_asset_file_contents(joined_asset_path, asset_paths)
ret = write_asset_file_contents_stock(joined_asset_path, asset_paths)
if File.extname(joined_asset_path) == ".js"
tmp_path = "#{RAILS_ROOT}/tmp/asset_combined.js"