I hereby claim:
- I am markhuge on github.
- I am markhuge (https://keybase.io/markhuge) on keybase.
- I have a public key whose fingerprint is 6450 7421 25CF B80C C9EA 6BB6 8EA2 79E6 5667 3B23
To claim this, I am signing this object:
// Pseudoclassical class pattern | |
// Constructor | |
function myThing() { | |
// under the hood 'this' is mapped to a new object | |
// created from myThing's prototype and NOT to myThing | |
this.name = "myThing"; | |
} | |
I hereby claim:
To claim this, I am signing this object:
Elastic beanstalk runs npm install
with a system user that has no homedir. During the npm install step, it's expecting a $HOME
env variable for the npm cache (which doesn't exist). add this file to your project's .ebextensions
directory to have it use root's homedir as a temporary path.
This workaround was provided by AWS support, but it doesn't appear to be documented anywhere. Determining root cause on this was a massive pain in the ass. Sharing this so others don't need to feel the pain.
Handlebars.registerHelper 'timesince', (date) -> | |
seconds = Math.floor((new Date() - new Date(date)) / 1000) | |
interval = Math.floor seconds / 31536000 | |
if interval > 1 | |
return new Handlebars.SafeString interval + " years" | |
interval = Math.floor seconds / 2592000 | |
if interval > 1 | |
return new Handlebars.SafeString interval + " months" | |
# This will return either JSON or JSONP depending on the existence of a callback. | |
def jsonp(request, dictionary): | |
if (request.query.callback): | |
return "%s(%s)" % (request.query.callback, dictionary) | |
return dictionary | |
@route('/something') | |
def something(): | |
return jsonp(dict(success="It worked")) |
I copied my .csshrc to a new machine, and needed to add a domain suffix to the hostnames of 20+ VMs in my cluster config. All of my hostnames end in at least 2 digits (foo-bar-baz-01), so I:
Append domain suffix where none exists:
Search: ([0-9]{2})\s
Replace: \1.my.domain.suffix
// Loop through Jenkins projects, adding a git repo for any project without a repo defined. | |
def projects = hudson.model.Hudson.instance; | |
projects.getItems(hudson.model.Project).each { | |
proj -> | |
if (proj.getScm().type == "hudson.scm.NullSCM") { | |
proj.scm = new hudson.plugins.git.GitSCM("git://path/to/your/repo.git"); | |
println("Project: " + proj.displayName + " SCM: " + proj.getScm().type); | |
} | |
} |