Skip to content

Instantly share code, notes, and snippets.

View 1o1brian's full-sized avatar

Brian Johnson 1o1brian

View GitHub Profile
@1o1brian
1o1brian / gist:1468978
Created December 12, 2011 20:37
The datatable's twitter bootstrap javascript had a bug here's the fixed version
/* API method to get paging information */
$.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )
{
return {
"iStart":         oSettings._iDisplayStart,
"iEnd":           oSettings.fnDisplayEnd(),
"iLength":        oSettings._iDisplayLength,
"iTotal":         oSettings.fnRecordsTotal(),
"iFilteredTotal": oSettings.fnRecordsDisplay(),
11:21:12,774 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) Starting deployment of "atlas-knob.yml"
11:21:13,285 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.unit."atlas-knob.yml".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."atlas-knob.yml".PARSE: Failed to process phase PARSE of deployment "atlas-knob.yml"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.x.incremental.260.jar:7.x.incremental.260]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPool
# thanks to railscasts
class Object
# macvim
def mvim(method_name)
file, line = method(method_name).source_location
`mvim #{file} +#{line}`
end
# sublime text
@1o1brian
1o1brian / gist:3658007
Created September 6, 2012 16:14
http with go
package main
import ("net/http" ; "io")
func hello(res http.ResponseWriter, req *http.Request) {
res.Header().Set(
"Content-Type",
"text/html",
)
io.WriteString(
@1o1brian
1o1brian / gist:5489276
Created April 30, 2013 14:58
jshint defaults
{
asi : true, // if automatic semicolon insertion should be tolerated
bitwise : true, // if bitwise operators should not be allowed
boss : true, // if advanced usage of assignments should be allowed
browser : true, // if the standard browser globals should be predefined
couch : true, // if CouchDB globals should be predefined
curly : true, // if curly braces around all blocks should be required
debug : true, // if debugger statements should be allowed
devel : true, // if logging globals should be predefined (console,
// alert, etc.)
As soon as you're tempted to explain code with a comment, extract the logic into a new method.
Life is so much better when you do.
- Nathan Hopkins @hopsoft