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
#!/usr/bin/env bash | |
# Pre-requisites | |
# Add Node.js PPA | |
sudo add-apt-repository ppa:chris-lea/node.js -y | |
# # Install Mongodb | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 -y | |
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list |
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
#!/usr/bin/env bash | |
# Pre-requisites | |
sudo apt-get install software-properties-common -y | |
# Add Node.js PPA | |
sudo add-apt-repository ppa:chris-lea/node.js -y | |
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
00000000 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01 JFIF | |
00000010 00 01 00 00 ff db 00 84 00 03 02 02 03 02 02 03 | |
00000020 03 03 03 04 03 03 04 05 08 05 05 04 04 05 0a 07 | |
00000030 07 06 08 0c 0a 0c 0c 0b 0a 0b 0b 0d 0e 12 10 0d | |
00000040 0e 11 0e 0b 0b 10 16 10 11 13 14 15 15 15 0c 0f | |
00000050 17 18 16 14 18 12 14 15 14 01 03 04 04 05 04 05 | |
00000060 09 05 05 09 14 0d 0b 0d 14 14 14 14 14 14 14 14 | |
00000070 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 | |
00000080 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 | |
00000090 14 14 14 14 14 14 14 14 14 14 ff c0 00 11 08 03 |
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
recursive_route_convert = (_value, _key = '/', _stack = ['/'], _strict=false) -> | |
return _.flatten(_.map(_value, (__value, __key) -> | |
__stack = _.clone(_stack) | |
__stack.push(__key) | |
if _.isFunction(__value) | |
http_verb = __stack.splice(__stack.length - 2, 1)[0].toLowerCase() | |
if http_verb not in ['options','get','head','post','put','delete','trace','connect','patch'] | |
throw(new Error("#{http_verb} is not in the HTTP Methods white list")) | |
else | |
strict_url = __stack.join('/').replace(/\/+/g,'/') |
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
// | |
// DiaryVerticalTextView.swift | |
// Diary | |
// | |
// Created by kevinzhow on 15/3/6. | |
// Copyright (c) 2015年 kevinzhow. All rights reserved. | |
// | |
import UIKit | |
import CoreText |
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
func genSkillImageWithSkills(skills: [Skill]) -> UIImage { | |
let maxWidth:CGFloat = 170 | |
let marginTop:CGFloat = 3.0 | |
let marginLeft: CGFloat = 6.0 | |
let lineSpacing: CGFloat = 5.0 |
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 | |
export PATH="/bin:/sbin:/usr/sbin:/usr/bin" | |
OLDGW=`cat /tmp/vpn_oldgw` | |
route del -net 1.0.1.0 netmask 255.255.255.0 | |
route del -net 1.0.2.0 netmask 255.255.254.0 | |
route del -net 1.0.8.0 netmask 255.255.248.0 | |
route del -net 1.0.32.0 netmask 255.255.224.0 |
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
<App Theme="Basic"> | |
<JavaScript File="main.js" /> | |
<ScrollView Padding="30" ScrollPositionChanged="{Say}"> | |
<StackPanel ItemSpacing="20"> | |
<Each Items="{people}"> | |
<Rectangle> | |
<Stroke Width="2" Brush="#000" /> | |
<StackPanel ItemSpacing="5" Margin="10"> | |
<Text Value="{name}" FontSize="20" TextColor="#000" Margin="0"/> | |
<Text Value="{age}" TextColor="#aaa"/> |
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/sh | |
set -x | |
export PATH="/bin:/sbin:/usr/sbin:/usr/bin" | |
LOG='/tmp/autoddvpn.log' | |
LOCK='/tmp/autoddvpn.lock' | |
PID=$$ | |
EXROUTEDIR='/jffs/exroute.d' | |
INFO="[INFO#${PID}]" |
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 | |
export PATH="/bin:/sbin:/usr/sbin:/usr/bin" | |
OLDGW=192.168.0.1 | |
route add -net 1.0.1.0 netmask 255.255.255.0 gw $OLDGW | |
route add -net 1.0.2.0 netmask 255.255.254.0 gw $OLDGW | |
route add -net 1.0.8.0 netmask 255.255.248.0 gw $OLDGW | |
route add -net 1.0.32.0 netmask 255.255.224.0 gw $OLDGW | |
route add -net 1.1.0.0 netmask 255.255.255.0 gw $OLDGW |
OlderNewer