This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Given a logfile with pairwise loglines when an event starts, and when it finishes, | |
# this script plots the duration for the events. | |
# Feed me a log file with rows like these: | |
# 2014-07-21 07:50:03,440 INFO Begin job | |
# 2014-07-21 07:52:50,530 INFO End job | |
# 2014-07-21 08:00:03,044 INFO Begin job | |
# 2014-07-21 08:02:02,548 INFO End job |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rlwrap tr -d '\n\r' | tr -sc [:alnum:] '_' | tr [:upper:] [:lower:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.ByteArrayInputStream | |
import java.io.ByteArrayOutputStream | |
import scala.sys.process._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.Future | |
import scala.concurrent.blocking | |
import scala.concurrent.Await | |
import scala.concurrent.duration._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jdbc:postgresql://<host>:<port>/<dbname>?user=<username>&password=<password> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a bookmarklet with the following line: | |
// javascript:(function(){document.body.appendChild(document.createElement('script')).src='https://gist.githubusercontent.com/ramn/fa7f13b736f872e6f506/raw/normalize_bookmarklet.js';})(); | |
var s=document.body.style; | |
s.fontFamily='"Optima", "ubuntu light", "lucida grande", verdana'; | |
s.background='#EEEEEE'; | |
s.color='black'; | |
for (i=0; i<document.links.length; i++) { | |
document.links[i].style.color='blue'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){f='http://www.delicious.com/save?url='+encodeURIComponent(window.location.href.replace(/utm_source=[^&]+&?|utm_medium=[^&]+&?|utm_campaign=[^&]+&?|utm_content=[^&]+&?/g, "").replace(/[?&]+$/, ""))+'&title='+encodeURIComponent(document.title)+'¬es='+encodeURIComponent(''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text))+'&v=6&';a=function(){if(!window.open(f+'noui=1&jump=doclose'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){f='http://www.delicious.com/save?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'¬es='+encodeURIComponent(''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text))+'&v=6&';a=function(){if(!window.open(f+'noui=1&jump=doclose','deliciousuiv6','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val feed = xml.XML.load(new java.net.URL("http://feeds.delicious.com/v2/rss/some_user/some_tag")) | |
for (item <- feed \\ "item") { | |
println(item \\ "title" text) | |
println(item \\ "link" text) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val varPattern = """\$\{([^}]*)}""".r | |
def template(text: String, vars: Map[String, String]) = | |
varPattern replaceSomeIn (text, m => vars get (m group 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){q=location.href.replace(/utm_source=[^&]+&?|utm_medium=[^&]+&?|utm_campaign=[^&]+&?|utm_content=[^&]+&?/g, "").replace(/[?&]+$/, "");if(document.getSelection){d=document.getSelection();}else{d='';};p=document.title;full_url='https://pinboard.in/add?url='+encodeURIComponent(q)+'&description='+encodeURIComponent(d)+'&title='+encodeURIComponent(p); a=function(){if(!window.open(full_url))location.href=full_url};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})(); |
OlderNewer