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> | |
<script src='http://code.jquery.com/jquery-1.5.1.min.js'></script> | |
</head> | |
<body> | |
<h2>Naive canvas</h2> | |
<canvas id="naive" width="400" height="50"></canvas> | |
<h2>High-def Canvas</h2> |
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
/** | |
* DateUtils getRelativeTimeSpanString methods which cares about time zone | |
* @param date date for which you want time ago | |
* @param timeZone time zone in which is date | |
* @return time ago string | |
*/ | |
public static String timeAgoFromDate(Date date, TimeZone timeZone) { | |
TimeZone defaultTimeZone = TimeZone.getDefault(); | |
TimeZone.setDefault(timeZone); |
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
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec |
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/bash -e | |
# | |
# package-ipa.sh | |
# | |
# Bundles an iOS app correctly, using the same directory structure that Xcode does when using the export functionality. | |
# | |
xcarchive="$1" | |
output_ipa="$2" |
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 Promise = require('bluebird'); | |
/** | |
* Periodically poll a signal function until either it returns true or a timeout is reached. | |
* | |
* @param signal function that returns true when the polled operation is complete | |
* @param interval time interval between polls in milliseconds | |
* @param timeout period of time before giving up on polling | |
* @returns true if the signal function returned true, false if the operation timed out | |
*/ |
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
runtime: nodejs | |
api_version: 1 | |
vm: true | |
env_variables: | |
PORT: 8080 | |
MEMCACHE_URL: memcache:11211 |