Demonstration about using cors proxy to help retrieve data in client side
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://practicalcryptography.com/ciphers/enigma-cipher/ 網頁內的 javascript 程式碼 | |
var c = console; | |
var plaintext = 'ABCDEF'; | |
c.log('>> plaintext2 : '+plaintext); | |
var ciphertext = Encrypt(plaintext, 'AAA', 'AAA', '123', 'POMLIUKJNHYTGBVFREDC'); | |
c.log('>> ciphertext : '+ciphertext); | |
var plaintext2 = Encrypt(ciphertext, 'AAA', 'AAA', '123', 'POMLIUKJNHYTGBVFREDC'); | |
c.log('>> plaintext2 : '+plaintext); |
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
// add your variants of | |
a ? b : c | |
// in comments :) | |
// a is boolean | |
// b and c - any type | |
// lazy evaluation isnt important |
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
# Install graphics magick v1.3.18 from source (run as root) | |
# Install dependencies | |
apt-get build-dep graphicsmagick -y | |
# Download source | |
wget http://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick/1.3.18/GraphicsMagick-1.3.18.tar.bz2 | |
tar -xvjf GraphicsMagick-1.3.18.tar.bz2 | |
cd GraphicsMagick-1.3.18 |
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
// Include gulp | |
var gulp = require('gulp'); | |
// Include Our Plugins | |
var sass = require('gulp-sass'); | |
var lr = require('tiny-lr'), | |
refresh = require('gulp-livereload'), | |
server = lr(); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
@-webkit-keyframes slowspin { | |
from { | |
-webkit-transform: rotateX(-33.5deg) rotateY(45deg); |
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
INFOPLIST="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
echo "writing to $INFOPLIST" | |
PLISTCMD="Add :SERVER_IP string $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)" | |
echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true | |
PLISTCMD="Set :SERVER_IP $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)" | |
echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || 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
#if DEBUG | |
#if TARGET_OS_SIMULATOR | |
#warning "DEBUG SIMULATOR" | |
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; | |
#else | |
#warning "DEBUG DEVICE" | |
NSString *serverIP = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"SERVER_IP"]; | |
NSString *jsCodeUrlString = [NSString stringWithFormat:@"http://%@:8081/index.ios.bundle?platform=ios&dev=true", serverIP]; | |
NSString *jsBundleUrlString = [jsCodeUrlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | |
jsCodeLocation = [NSURL URLWithString:jsBundleUrlString]; |
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
# Put this in /etc/logrotate.d/mongodb | |
# http://stackoverflow.com/questions/5004626/mongodb-log-file-growth | |
/var/log/mongo/*.log { | |
daily | |
rotate 30 | |
compress | |
dateext | |
missingok | |
notifempty |
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 AWS = require('aws-sdk'); | |
var chain = new AWS.CredentialProviderChain(); | |
var credentials | |
AWS.CredentialProviderChain.defaultProviders = [ | |
function () { return new AWS.EnvironmentCredentials('AWS'); }, | |
function () { return new AWS.EnvironmentCredentials('AMAZON'); }, | |
function () { return new AWS.SharedIniFileCredentials({profile: 'my_profile_name'}); }, | |
function () { return new AWS.EC2MetadataCredentials(); } | |
] |
OlderNewer