Skip to content

Instantly share code, notes, and snippets.

Alex Coles myabc

View GitHub Profile
@bumi
bumi / gist:27085
Created Nov 20, 2008
fakebug - don't let console.log break your code on browsers without firebug
View gist:27085
var fakebug = function() {
var firebug_methods = ["log", "info", "debug", "warn", "error", "assert", "dir", "dirxml", "trace", "group", "groupEnd", "time", "timeEnd", "profile", "profileEnd", "count"];
window.console = {};
for(var i=0;i<firebug_methods.length;i++) {
window.console[firebug_methods[i]] = function() {};
}
};
if(!window.console) { fakebug(); }
View gist:601724
function highdpi_init() {
if(jQuery('.replace-2x').css('font-size') == "1px") {
var els = jQuery(".replace-2x").get();
for(var i in els) {
var src = els[i].src
src = src.replace(".png", "@2x.png");
els[i].src = src;
}
}
}
View gist:911313
#!/bin/sh
#
# Startup script for the Jenkins Continuous Integration server
# (via Jakarta Tomcat Java Servlets and JSP server)
#
# chkconfig: - 85 15
# description: Jakarta Tomcat Java Servlets and JSP server
# processname: tomcat
# pidfile: /var/run/jenkins.pid
View 10-ways-to-improve-github-issues.md

10 Ways to improve Github Issues

I love the new GitHub issues, here are some ideas to make it perfect, ordered by priority:

1. I should be able to pick the assignee and milestone via keyboard when creating a new ticket

2. Keyboard shortcuts should work everywhere. E.g. when viewing an existing issue, 'c' does not work.

3. After creating an issue, the assigned user / milestone should be remembered and pre-filled.

4. Allow assigning a different user while commenting. Right now this deletes my half-typed comment.

5. When typing the @ symbol to mention somebody, it should auto-complete the name.

6. Things feel a little sluggish right now, any speed improvements would be very welcome.

View gist:961630
2011-05-08 20:11:56,684 INFO [Log4jLogger] : DataObjects::SQLError - DSRA9122E: class com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement enthält keine Objekte vom Typ interface oracle.jdbc.OraclePreparedStatement.:
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:276:in `with_connection'
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:113:in `create'
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle/jruby/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:85:in `each'
C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WEB-WINDOWS7DEVNode01Cell/bds_war.ear/bds.war/WEB-INF/bundle
View psych_yml_tester.rb
# USAGE:
# ruby -e "$(curl -fsSL https://raw.github.com/gist/1011972/2e6ac978bc06905f60e380b5fe5abbf898b3af0a)" <directory>
# for example:
# ruby -e "$(curl -fsSL https://raw.github.com/gist/1011972/2e6ac978bc06905f60e380b5fe5abbf898b3af0a)" .
require 'rubygems'
require 'yaml'
YAML::ENGINE.yamler = 'psych'
directory = ARGV[0]
@kilaulena
kilaulena / gist:2561283
Created Apr 30, 2012
Drilling in your wall and not in cables
View gist:2561283
TIL when you drill in your wall (eg to hang up a shelf), these are ways to avoid drilling into a power
supply:
- I always thought this rule of thumb would suffice: do not drill within a straight vertical or
horizontal line from power sockets. TIL in Germany to be on the safe side, you need to add a 20cm safety
distance to each side of these lines. Within this distance can be supply lines too!
- Power supply line detectors are worthless when they are cheap, the pricier ones can help you a bit, but
they still are no guarantee: when the lines are deeper within the wall, they can not be detected exactly
at all.
@sj26
sj26 / assets.rake
Last active Dec 12, 2015
Don't discard cache during asset precompile. Full explanation and caveats: http://sj26.com/2013/02/09/the-asset-pipeline-isnt-actually-slow
View assets.rake
# Stick this in lib/tasks/assets.rake or similar
#
# A bug was introduced in rails in 7f1a666d causing the whole application cache
# to be cleared everytime a precompile is run, but it is not neccesary and just
# slows down precompiling.
#
# Secondary consequences are the clearing of the whole cache, which if using
# the default file cache could cause an application level performance hit.
#
# This is already fixed in sprockets-rails for rails 4, but we patch here for
@andresgutgon
andresgutgon / Selector de Idioma con Rails 2.3.8
Created Aug 18, 2010
Desplegar los idiomas que estan disponibles en tu App y setear el valor para cada usuario
View Selector de Idioma con Rails 2.3.8
#Selector de idioma
#dependencias:
# 1 - Rack locale del paquete Rack-contrib [1]
# USO: Se usa para detectar el idioma definido por el usuario en su browser ['HTTP_ACCEPT_LANGUAGE']
# Esplicado aquí http://guides.rubyonrails.org/i18n.html#using-accept-language
# [1] http://github.com/rack/rack-contrib
# 2 - Routing-filter [1]
# USO: Establecer el locale en las URLs ej.: www.mysite.com/es/foo/bar
# NOTA: Si tambien quieres traducir las URL's usa la gema de Raul Murciano Translate_routes [2] (De momento sin cobertura para Rails3)
You can’t perform that action at this time.