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
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql |
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 ccToMap(cc: AnyRef) = | |
(Map[String, Any]() /: cc.getClass.getDeclaredFields) { | |
(a, f) => | |
f.setAccessible(true) | |
a + (f.getName -> f.get(cc)) | |
} | |
// Usage | |
case class Column(name: String, |
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 myRequest = "http://somehost.com" / "some" / "path" <<? Map("id" -> "12345") |
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 scalaz._ | |
object Main { | |
case class FizzBuzz(elems: String*) | |
implicit object FizzBuzzMonoid extends Monoid[FizzBuzz] { | |
override def zero = FizzBuzz() | |
override def append(f1: FizzBuzz, f2: => FizzBuzz): FizzBuzz = FizzBuzz(f1.elems ++ f2.elems :_*) | |
} |
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
implicit def flipImplicitlyCurried[A,B,C](f: A => B => C) = (b: B) => (a: A) => f(a)(b) |
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
ace.require("ace/lib/net").loadScript("https://raw.github.com/ajaxorg/ace-builds/master/src-min-noconflict/keybinding-vim.js", function() { | |
e = $(".file-contents").codeEditor().editor; | |
e.setKeyboardHandler(ace.require("ace/keyboard/vim").handler); | |
}) |
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
/** Fix navigation bar width */ | |
.global-nav .container { max-width: 910px; } | |
/** Hide Me & DM menu items */ | |
.global-nav li.profile, .global-nav .dm-nav { display: none; } | |
/** Remove bottom border from active menu item and just set text color to black instead */ | |
#global-actions > li > a { border-bottom: none; } | |
#global-actions > li:hover > a, #global-actions>li.active>a { color: black; } |
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
alert((![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]); |
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
ace.require("ace/lib/net").loadScript("https://raw.github.com/ajaxorg/ace-builds/master/src-min-noconflict/keybinding-vim.js", function() { | |
e = document.getElementById("ace-editor").env.editor; | |
e.setKeyboardHandler(ace.require("ace/keyboard/vim").handler); | |
}) |
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 recfun | |
import common._ | |
import scala.annotation.tailrec | |
object Balance { | |
def balance(chars: List[Char]): Boolean = { | |
@tailrec | |
def loop(chars: List[Char], open: Int): Boolean = { | |
chars match { | |
case Nil => open == 0 |