Skip to content

Instantly share code, notes, and snippets.

View esses's full-sized avatar
🏎️
gone racing

sven chen esses

🏎️
gone racing
View GitHub Profile
@esses
esses / bookmark.js
Created November 15, 2011 20:28
Quick Cross-Browser jQuery Bookmark Script
$('a#bookmark').click(function(e){
e.preventDefault();
var bookmarkURL = this.href;
var bookmarkTitle = this.title;
try {
if (window.sidebar) { // moz
window.sidebar.addPanel(bookmarkTitle, bookmarkURL, "");
} else if (window.external || document.all) { // ie
window.external.AddFavorite(bookmarkURL, bookmarkTitle);
} else if (window.opera) { // duh
@esses
esses / gist:3418021
Created August 21, 2012 18:12
Learned LiftWeb Tricks

Skip Lift Processing

For /static/page-skips-lift.html, the following code in Boot.scala skips Lift processing and defers to tomcat/jetty/whatever for a truly static file. This also allows you to avoid loading of liftAjax.js on a per page basis.

    case Req("static" :: "page-skips-lift" :: Nil, "html", _) => false
}```

### Resource ID For Asset Caching
@esses
esses / # hhvm - 2016-04-23_12-48-58.txt
Created April 23, 2016 19:53
hhvm (hhvm/hhvm/hhvm) on Mac OS X 10.11.3 - Homebrew build logs
Homebrew build logs for hhvm/hhvm/hhvm on Mac OS X 10.11.3
Build date: 2016-04-23 12:48:58
#!/bin/bash
set -e
end=$((SECONDS+7200))
while [ $SECONDS -lt $end ]; do
curl --data "returnResponse=true&FORM_CODE=nhl_2016_ea_cover_vote&round=3&player1=pavelski&player2=&player3=&player4=" https://pubservices.bamnetworks.com/s/FormService/FormSubmitServlet
printf " : vote for #NHL17Pavelski\n"
sleep $[ ( $RANDOM % 3 ) + 1 ]s