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
/* | |
Overview | |
-------- | |
To run a query using anorm you need to do three things: | |
1. Connect to the database (with or without a transaction) | |
2. Create an instance of `anorm.SqlQuery` using the `SQL` string interpolator | |
3. Call one of the methods on `SqlQuery` to actually run the query |
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
# http://stackoverflow.com/a/646643 | |
String::startsWith ?= (s) -> @slice(0, s.length) == s | |
String::endsWith ?= (s) -> s == '' or @slice(-s.length) == s |
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 net.sergeych.utils; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
/** | |
* Binary to text encoder suitable to use encoded strings as any parts of urls | |
* and parts of file names safely even on case-insensitive systems. Human | |
* friendly, easy to retype from print or from voice, treats confusing |
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
Function::property = (prop, desc) -> | |
Object.defineProperty @prototype, prop, desc | |
class Person | |
constructor: (@firstName, @lastName) -> | |
@property 'fullName', | |
get: -> "#{@firstName} #{@lastName}" | |
set: (name) -> [@firstName, @lastName] = name.split ' ' | |
p = new Person 'Leroy', 'Jenkins' |