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
REM netsh interface ipv4 set address name="YOUR INTERFACE NAME" static IP_ADDRESS SUBNET_MASK GATEWAY | |
REM netsh interface ipv4 set dns name="YOUR INTERFACE NAME" static DNS_SERVER | |
netsh interface ipv4 set address name="Local Area Connection" static 192.168.100.252 255.255.255.0 192.168.100.1 | |
netsh interface ipv4 set dns name="Local Area Connection" static 114.114.114.114 | |
REM refer: http://www.howtogeek.com/103190/change-your-ip-address-from-the-command-prompt/ |
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> | |
<body> | |
<!--from infoQ: 12行代码的DoS攻击分析及防御--> | |
<script type="text/javascript"> | |
var total = ""; | |
for (var i=0; i<100000000; i++){ | |
total = total + i.toString(); | |
history.pushState(0,0,total); | |
} |
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 <iostream> | |
using namespace std; | |
int main(int argc, char const *argv[]) | |
{ | |
int array[100][2], count, cina, cinb; | |
count = 0; | |
cout << "input:" << endl; | |
while ( cin >> cina >> cinb ){ | |
array[count][0] = cina; |
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 <iostream> | |
using namespace std; | |
int main(int argc, char const *argv[]) | |
{ | |
const char *p = "shuoming"; // note: const | |
cout << "sizeof(p): " << sizeof(p) << endl; | |
while (*p){ | |
cout << "p++: " << p++ << endl; | |
} |
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 gulp = require('gulp'); | |
/* plugins: | |
** npm install --save-dev | |
** gulp-uglify gulp-rename gulp-concat gulp-sass | |
** gulp-minify-css gulp-autoprefixer | |
*/ | |
var uglify = require('gulp-uglify'), // js compress | |
rename = require('gulp-rename'), // file rename | |
concat = require('gulp-concat'), // file combine |
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
/** | |
* version1: convert online image | |
* @param {String} url | |
* @param {Function} callback | |
* @param {String} [outputFormat='image/png'] | |
* @author HaNdTriX | |
* @example | |
convertImgToBase64('http://goo.gl/AOxHAL', function(base64Img){ | |
console.log('IMAGE:',base64Img); | |
}) |
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
/* | |
*假设有2个函数firstFunction和secondFunction需要在网页加载完毕时执行, 需要绑定到window。onload。如果通过: | |
* | |
* window.onload = firstFunction; | |
* window.onload = secondFunction; | |
* 结果是只有secondFunction会执行,secondFunction会覆盖firstFunction。 | |
*/ | |
/* | |
*正确的方式是: |
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
# modify etc/profile | |
# normalize HOME to unix path | |
HOME="/e/GitRep" | |
HOME="$(cd "$HOME" ; pwd)" | |
cd | |
export PATH="$HOME/bin:$PATH" |
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
import datetime, getpass | |
import sublime, sublime_plugin | |
class InsertDatetimeCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
self.view.run_command("insert_snippet", { "contents": "%s" % datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") } ) | |
# self.view.run_command("insert_snippet", { "contents": "%s" % datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S %a") } ) |