Skip to content

Instantly share code, notes, and snippets.

View stan's full-sized avatar
💭
¯\_(ツ)_/¯

stan

💭
¯\_(ツ)_/¯
View GitHub Profile
@stan
stan / ie67891011-css-hacks.txt
Created March 8, 2017 15:21 — forked from ricardozea/ie67891011-css-hacks.txt
IE CSS hacks - IE6, 7, 8, 9, 10, 11
IE6 Only
==================
_selector {...}
IE6 & IE7
==================
*html or { _property: }
IE7 Only
==================
@stan
stan / proxy.rb
Last active August 29, 2015 14:21 — forked from torsten/proxy.rb
#!/usr/bin/env ruby
# A quick and dirty implementation of an HTTP proxy server in Ruby
# because I did not want to install anything.
#
# Copyright (C) 2009-2014 Torsten Becker <torsten.becker@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
authenticated do
root :to => 'teachers/dashboards#show', :constraints => lambda{ |req| req.session['warden.user.user.key'][0] == 'Teacher' }
root :to => 'students/dashboards#show', :constraints => lambda{ |req| req.session['warden.user.user.key'][0] == 'Student' }
end
build_package_combined_patch() {
local package_name="$1"
{
curl https://raw.github.com/skaes/rvm-patchsets/master/patchsets/ruby/1.9.3/p448/railsexpress | xargs -I % curl https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p448/% | patch -p1
autoconf
./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
make -j 8
make install
} >&4 2>&1
@stan
stan / 1.9.3-p392-railsexpress
Last active December 15, 2015 02:09
1.9.3-p392-railsexpress
build_package_combined_patch() {
local package_name="$1"
{
curl https://raw.github.com/skaes/rvm-patchsets/master/patchsets/ruby/1.9.3/p392/railsexpress | xargs -I % curl https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p392/% | patch -p1
autoconf
./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
make -j 8
make install
} >&4 2>&1
@stan
stan / 1.9.3-p385-falcon
Last active December 12, 2015 12:09
Performance patch for rbenv ruby 1.9.3-p385 (funny-falcon with backport-gc)
build_package_combined_patch() {
local package_name="$1"
{
curl https://github.com/funny-falcon/ruby/compare/p385...p385_falcon_gc.diff | patch -p1
autoconf
./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
make -j 8
make install
} >&4 2>&1
@stan
stan / undo.rb
Created September 27, 2012 10:08
Undo for mongoid
module Mongoid
module Undo
extend ActiveSupport::Concern
included do
include Mongoid::Document
field :version, type: Integer, default: 0
before_save :prepare_versioning
after_save :create_version
@stan
stan / gist:1704142
Created January 30, 2012 12:24
Look Up in 1Password
javascript:window.location='onepassword://'+window.location.href.substring(window.location.href.indexOf('//')+2)
@stan
stan / changes.diff
Created October 12, 2011 06:37
Differences between Rails 3.0.9 & Rails 3.1.1 generated apps (all in one)
Only in 3.1.1/blank/app: assets
Only in 3.1.1/blank/app/mailers: .gitkeep
Only in 3.1.1/blank/app/models: .gitkeep
diff -U 0 -r 3.0.9/blank/app/views/layouts/application.html.erb 3.1.1/blank/app/views/layouts/application.html.erb
--- 3.0.9/blank/app/views/layouts/application.html.erb 2011-10-12 15:17:34.853020000 +0900
+++ 3.1.1/blank/app/views/layouts/application.html.erb 2011-10-12 15:23:26.162309000 +0900
@@ -5,3 +5,3 @@
- <%= stylesheet_link_tag :all %>
- <%= javascript_include_tag :defaults %>
- <%= csrf_meta_tag %>
ActionController::RoutingError (No route matches "/webconsole"):
lib/rack/runtime.rb:18:in `call'
Rendered /home/stan/.rvm/gems/ruby-1.9.2-p290@skeleton/gems/actionpack-3.0.9/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.3ms)