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
android { | |
... | |
lintOptions { | |
// set to true to turn off analysis progress reporting by lint | |
quiet true | |
// if true, stop the gradle build if errors are found | |
abortOnError false | |
// if true, only report errors | |
ignoreWarnings true |
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
class CSVLibrary(object): | |
def read_csv_file(self, filename): | |
file = open(filename, 'r') | |
csvfile = csv.reader(file) | |
file.close | |
return [row for row in csvfile] |
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 class X { | |
private static X instance = null; | |
private X() {} | |
public static X instance() { | |
if (instance == null) | |
instance = new X(); | |
return instance; | |
} |
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
curl -XGET 'localhost:9200/twitter/_analyze?pretty=1&field=message' -d "Hello #Elasticsearch with @somkiat" | |
{ | |
"tokens" : [ { | |
"token" : "hello", | |
"start_offset" : 0, | |
"end_offset" : 5, | |
"type" : "word", | |
"position" : 1 | |
}, { | |
"token" : "#elasticsearch", |
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
class ImageValidator{ | |
public function validate($value, Constraint $constraint){ | |
if (null === $value || '' === $value) { | |
return; | |
} | |
if (null === $constraint->minWidth && null === $constraint->maxWidth) { | |
return; | |
} |
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
class Company { | |
public int id; | |
public String name; | |
} |
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 class UserService { | |
private final UserDAO userDAO; | |
public UserService(UserDAO userDAO) { | |
this.userDAO = userDAO; | |
} | |
public void createUser(User user) { | |
//Some business logic and validation and etc | |
userDAO.save(user); |
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
class BusinessModel a where | |
data Event a :: * | |
data Command a :: * | |
init :: a | |
act :: Command a -> a -> Event a | |
apply :: Event a -> a -> 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
import static java.lang.System.out; | |
public class Aha { | |
public static void main(String ... args) { | |
Integer a = 1000, b = 1000; | |
out.println(a == b); | |
Integer c = 100, d = 100; | |
out.println(c == d); | |
} | |
} |
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
//https://khom.wordpress.com/2010/04/21/convert-mp4-and-flv-video-to-mp3-with-vlc/ | |
for file in //Users/somkiat/Desktop/agile-tour-2015/Ked2/*.wma; | |
do /Applications/VLC.app/Contents/MacOS/VLC -I dummy "$file" --sout="#transcode{acodec=mp3,vcodec=dummy}:standard{access=file,mux=raw,dst=\"$(echo "$file" | sed 's/\.[^\.]*$/.mp3/')\"}" vlc://quit; | |
done |