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
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */ | |
{ | |
/* | |
* Keybindings for emacs emulation. | |
* | |
* WARNING! After Mountain Lion, this file cannot be symbolic linked to another file, | |
* you need to put this file in ~/Library/KeyBindings/DefaultKeyBinding.dict directly | |
* | |
* Reference: |
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
def line | |
new File("test.txt").withReader { line = it.readLine() } | |
println line |
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
-- show running queries (9.2) | |
SELECT pid, client_addr, age(clock_timestamp(), query_start), usename, query, state | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- kill running query | |
SELECT pg_cancel_backend(procpid); | |
-- kill idle query |
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
package main | |
import ( | |
"log" | |
"os/exec" | |
"syscall" | |
"time" | |
) | |
type Process struct { |
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
package yourpackage | |
import org.scalatra.auth.strategy.BasicAuthSupport | |
import org.scalatra.auth.{ScentryConfig, ScentryStrategy, ScentrySupport} | |
import org.scalatra.{ScalatraBase, Unauthorized} | |
import javax.servlet.http.{HttpServletRequest, HttpServletResponse} | |
import java.util.Locale | |
class TokenAuthRequest(r: HttpServletRequest) { |
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
The Phoenix Project | |
Meditations | |
Ego Is the Enemy | |
Smarter Faster Better | |
Flash Boys: A Wall Street Revolt |
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
Fiction: | |
On Writing (Stephen King) | |
Masters of Doom | |
Hackers: Heroes of the computing revolution | |
Sci fi: | |
Ready Player One | |
Cryptonomicon | |
Old Mans War |
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
def timeMethod(method, message) { | |
def startTime = System.currentTimeMillis() | |
method() | |
def totalTime = System.currentTimeMillis() - startTime | |
log.info "${message} ${totalTime} ms" | |
} | |
... | |
timeMethod({ someMethod() }, "someMethod Time:") | |
... |
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
require 'kramdown' | |
puts Kramdown::Document.new(File.open('test.md').read).to_html |
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
def updateBuildVersion(currentVersion, updateType) { | |
def versionMatcher = currentVersion =~ /^(\d+)\.(\d+)\.(\d+)$/ | |
def major = versionMatcher[0][1].toInteger() | |
def minor = versionMatcher[0][2].toInteger() | |
def patch = versionMatcher[0][3].toInteger() | |
if (updateType == 'patch') | |
patch += 1 | |
else if (updateType == 'minor') | |
minor += 1 |
NewerOlder