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
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="ys" | |
# Example aliases |
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
alias searchjava="find . -name '*.java' | xargs grep -n " |
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
<snippet> | |
<content><![CDATA[ | |
;(function() { | |
})(); | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>iffy</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.js</scope> |
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
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; |
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
package cworks.jackson; | |
import com.fasterxml.jackson.core.JsonFactory; | |
import com.fasterxml.jackson.core.JsonParser; | |
import com.fasterxml.jackson.core.JsonToken; | |
import junit.framework.Assert; | |
import org.junit.Test; | |
import java.io.IOException; |
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
#!/usr/bin/env groovy | |
total = 132; | |
page_size = 10; | |
num_pages = (int)Math.ceil(total / page_size); | |
firstPageOnError = false; | |
class PageOutOfRangeException extends RuntimeException{}; | |
def pagination(page) { |
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
#!/usr/bin/env groovy | |
total = 132; | |
page_size = 10; | |
num_pages = (int)Math.ceil(total / page_size); | |
def pagination(page) { | |
if(page < 0 || page >= num_pages) { | |
page = 0; // set to first page | |
} |
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
/* | |
* We can create, invoke and assign a local-scope anonymous function to | |
* a variable and client code can use that as the top-level module name. | |
* One nice thing about this simple pattern is it creates an encapulated | |
* scope. For example 'names' cannot be accessed from outside the local-scope | |
* function, clients can only access the functions we return, the return statement | |
* for all practical purposes defines the modules interface. | |
* | |
* Idea for this code borrowed from the wonderful book: | |
* Eloquent JavaScript by: Marijn Haverbeke |
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
var sendEmail = new Function('to', | |
'from', | |
'subject', | |
'body', | |
"console.info('Sending email: ' + body)"); | |
sendEmail('buckyATgmail.com', | |
'nachoATgmail.com', | |
'warning', | |
"Don't write code like this!"); |
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
emitted: [1367983439273,83] | |
debug - websocket writing 5:::{"name":"sample","args":[{"x":1367983439767,"y":89}]} | |
emitted: [1367983439767,89] | |
debug - websocket writing 5:::{"name":"sample","args":[{"x":1367983440274,"y":97}]} | |
emitted: [1367983440274,97] | |
debug - websocket writing 5:::{"name":"sample","args":[{"x":1367983440769,"y":39}]} | |
emitted: [1367983440769,39] | |
debug - websocket writing 5:::{"name":"sample","args":[{"x":1367983441275,"y":53}]} | |
emitted: [1367983441275,53] | |
debug - websocket writing 5:::{"name":"sample","args":[{"x":1367983441771,"y":32}]} |