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
public String get(String key, Object... o){ | |
if(o == null){ | |
return texts.getString(key); | |
} else { | |
String str = texts.getString(key); | |
for(int i = 0; i < o.length; i++) { | |
str = str.replace("{" + i + "}", o[i].toString()); | |
} | |
return str; | |
} |
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/sh | |
git filter-branch -f --env-filter ' | |
an="$GIT_AUTHOR_NAME" | |
am="$GIT_AUTHOR_EMAIL" | |
cn="$GIT_COMMITTER_NAME" | |
cm="$GIT_COMMITTER_EMAIL" | |
if [ "$GIT_COMMITTER_EMAIL" = "jon.doe@gmail.com" ] | |
then |
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/sh | |
git filter-branch -f --msg-filter 'sed "s/<old message>/<new message>/g"' -- --all |
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/sh | |
#TARFILE="jdk-7u17-linux-x64.tar.gz" | |
TARFILE="jdk-7u17-linux-i586.tar.gz" | |
# wget http://www.ken-soft.com/dl/jdk/$TARFILE | |
tar -xvf $TARFILE | |
if [ ! -d "/usr/lib/jvm/jdk1.7.0/" ]; then | |
sudo mkdir /usr/lib/jvm/jdk1.7.0/ | |
fi |
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
{ | |
html : { | |
head : { | |
title : 'Btiques', | |
style : { link : 'blah.css' }, | |
script : { link : 'blah.js' }, | |
meta : { name : 'foo', content : 'bar' } | |
}, | |
body : { | |
.hand-cursor : { |
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
var LIB = LIB || {}; | |
LIB.Facebook = {}; | |
LIB.Facebook.appId = 0; | |
LIB.Facebook.permissions = 'email'; | |
LIB.Facebook.jsLoaded = false; |
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
public abstract class Person { | |
private String name; | |
private int age; | |
private Boolean gender; | |
public Person(){ | |
name = "john"; |
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
numEmpty :: [Int] -> Int | |
numEmpty board = length $ filter (\x -> x == 0) board | |
addToColumn :: Int -> [Int] -> [Int] | |
addToColumn val board = xs ++ [val] ++ ys | |
where | |
n = (numEmpty board) | |
xs = replicate (n - 1) 0 | |
ys = snd (splitAt n board) |
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 Graphics.UI.SDL as SDL | |
import Data.Maybe | |
import Control.Monad | |
getSpriteSheetOffset :: Int -> Maybe Rect | |
getSpriteSheetOffset n = Just (Rect offx offy 32 32) | |
where | |
offx = mod (n * 32) (32 * 5) | |
offy = quot (n * 32) (32 * 5) * 32 |
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
data GameState = GameState { map :: [[Int]], timer :: Timer } | |
data GameSprites = GameSprites { sprites :: Surface, samus :: Surface} | |
newGame :: IO (GameState, GameSprites) | |
newGame = do | |
samus <- loadBMP "img/samus.bmp" | |
sprites <- loadBMP "img/spritesheet.bmp" | |
map <- [[]] | |
timer <- start defaultTimer |
OlderNewer