sbt gen-idea
This file contains hidden or 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 | |
# Put this file at: .git/hooks/post-checkout | |
# and make it executable | |
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587 | |
PREV_COMMIT=$1 | |
POST_COMMIT=$2 | |
NOCOLOR="\x1B[0m" |
This file contains hidden or 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
find src -name '*.php' -print0 | xargs -0 -I{} gsed -i 's/\(.*\)?>/\1/' '{}' |
This file contains hidden or 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 org.scalatest._ | |
class RomanNumbersTest extends FlatSpec with ShouldMatchers with BeforeAndAfterEach { | |
private var numbers: RomanNumbers = _ | |
override def beforeEach() { | |
numbers = new RomanNumbers | |
} | |
"Roman numbers" should "convert I to 1" in { |
This file contains hidden or 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
sealed abstract class JValue { | |
override def toString: String = { | |
this match { | |
case JString(value) => String.format("\"%s\"", value) | |
case JBool(true) => "true" | |
case JBool(false) => "false" | |
case JNumber(value) => value.toString | |
case JNull() => "null" | |
case JList(values) => "[" ++ values.map(_.toString).mkString(", ") ++ "]" | |
case JObject(values) => "{" ++ values.foldLeft("") { case (prefix, (key, value)) => prefix ++ String.format("\"%s\": %s", key, value) } ++ "}" |
This file contains hidden or 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
rotate :: String -> [String] | |
rotate l = rotate_recursive l [] | |
rotate_recursive :: String -> String -> [String] | |
rotate_recursive [] list = [] | |
rotate_recursive list1 list2 = | |
let (h1:t1) = list1 | |
in [list1 ++ list2] ++ rotate_recursive t1 (list2 ++ [h1]) | |
-- http://code.google.com/codejam/contest/1460488/dashboard#s=p2 |
launchctl load ~/Library/LaunchAgents/local.gmailbackup.plist
This file contains hidden or 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
# ADD this to Rakefile and run it by issuing rake roles.to_json | |
ROLE_DIR = File.expand_path(File.join(TOPDIR, "roles")) | |
namespace :roles do | |
desc "Convert ruby roles from ruby to json, creating/overwriting json files." | |
task :to_json do | |
Dir.glob(File.join(ROLE_DIR, '*.rb')) do |rb_file| | |
role = Chef::Role.new | |
role.from_file(rb_file) | |
json_file = rb_file.sub(/\.rb$/,'.json') |
This file contains hidden or 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
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 | |
# $Id$ | |
PortSystem 1.0 | |
name zlib | |
version 1.2.5 | |
categories archivers | |
maintainers landonf ryandesign openmaintainer | |
license zlib |
This file contains hidden or 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 | |
set -e | |
#cryptsetup luksFormat -c aes-ecb-plain -s 128 | |
#open, mount | |
cryptsetup luksOpen /dev/disk/by-uuid/e0f51d72-1331-4663-a4ac-281cacdbe691 backup | |
mount /media/backup |