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
// Create a new object with a subset of fields - it's useful in react-redux' connect() | |
// pick('name')({name: 'John', age: 35}) => {name: 'John'} | |
export const pick = (...fields) => o => fields.reduce((result, field) => { | |
result[field] = o[field]; | |
return result; | |
}, {}) |
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
@Override | |
public boolean dispatchTouchEvent(MotionEvent event){ | |
resetSessionTimeout(); | |
super.dispatchTouchEvent(event); | |
return false; | |
} |
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
for (ListIterator iter = annotsArray.listIterator(); iter.hasNext();) | |
{ | |
PdfDictionary annot = (PdfDictionary) PdfReader.getPdfObject( iter.next()); | |
PdfString content = (PdfString) PdfReader.getPdfObject(annot.get(PdfName.WIDTH)); | |
if (content != null) { | |
System.out.println(content); | |
} | |
} |
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
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { | |
NSMutableString* newText = [[NSMutableString alloc] init]; | |
[newText appendString:[textField.text substringWithRange:NSMakeRange(0, range.location)]]; | |
[newText appendString:string]; | |
NSLog(@"newText: %@", newText); | |
} |
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
<html> | |
<head> | |
<title>UK Post Code</title> | |
<style type="text/css"> | |
#map_canvas { width:300px; height:200px; } | |
</style> | |
<script type="text/javascript"> | |
function initialize() { |
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
tell application "Terminal" | |
activate | |
do script "cd my-project; ./script/server" | |
tell application "System Events" to tell process "Terminal.app" to keystroke "t" using command down | |
do script "cd my-project; mate ." in front window | |
tell application "System Events" to tell process "Terminal.app" to keystroke "t" using command down | |
do script "cd my-project; ./script/console" in front window | |
end tell |
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 sys = require('sys'), | |
http = require('http'), | |
url = require('url'), | |
request = require('./vendor/plugins/request/main'); | |
// Connect to DB | |
var db = require('./vendor/plugins/nodejs-mysql-native/mysql/client').createTCPClient('localhost', 8889); | |
db.auth('db_name', 'root', 'root'); | |
// Server |