Skip to content

Instantly share code, notes, and snippets.

@jbmyid
jbmyid / browser-class.js
Created March 7, 2017 06:03 — forked from realdeprez/browser-class.js
adds browser name+version class to html body tag
try{document.getElementsByTagName('body')[0].className+=' '+(/(Firefox|MSIE|Chrome|Safari|Opera)[\/\s](\d+)/).exec(navigator.userAgent).splice(1,2).join('').toLowerCase();}catch(e){}
@jbmyid
jbmyid / style.scss
Created July 4, 2014 07:22 — forked from daz/style.scss
.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
_width: 160px;
padding: 4px 0;
class ApplicationController < ActionController::Base
...
#Problem:
#In rails 3.0.1+ it is no longer possible to do this anymore;
# rescue_from ActionController::RoutingError, :with => :render_not_found
#
#The ActionController::RoutingError thrown is not caught by rescue_from.
#The alternative is to to set a catch-all route to catch all unmatched routes and send them to a method which renders an error
#As in http://techoctave.com/c7/posts/36-rails-3-0-rescue-from-routing-error-solution
@jbmyid
jbmyid / settings.js
Last active August 29, 2015 14:00 — forked from jcsrb/settings.js
/*
Add following in /home/usernam/.config/sublime-text-3/Packages/User/RubyTest.sublime-settings
If file not present then create one
in case you get errors like this
ruby:1: Invalid char `\x7F' in expression
ruby:1: Invalid char `\x01' in expression
ruby:1: Invalid char `\x01' in expression
ruby:1: Invalid char `\x01' in expression
ruby:1:in `<main>': uninitialized constant ELF (NameError)
Add these lines into ~/.gitconfig file.
---------------------------------------------------------------------
[alias]
st = status
ft = fetch
ci = commit
cm = commit -m
br = branch