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 i = 0; | |
var job = self.setInterval("deleteFile()", 1000); | |
function deleteFile() { | |
i = i + 1; | |
if ( i == 90 ){ | |
job = window.clearInterval(job) | |
}else{ | |
try | |
{ | |
//在这里运行代码 |
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 | |
a=1 #a is for the first number | |
for i in *.JPG; do #Replace JPG, then you can edit your file extension | |
new=$(printf "%04d.JPG" "$a") #04 pad to length of 4 | |
mv -i -- "$i" "$new" | |
let a=a+1 | |
done |
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 | |
yum install python-setuptools && easy_install pip && git | |
pip install git+https://github.com/shadowsocks/shadowsocks.git@master | |
echo '{ "server":"0.0.0.0", "server_port":8388, "password":"cashisking", "timeout":300, "method":"aes-256-cfb", "fast_open": false}' | tee /etc/shadowsocks.json | |
ssserver -c /etc/shadowsocks.json |
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 <ifaddrs.h> | |
#import <arpa/inet.h> | |
#import <net/if.h> | |
#define IOS_CELLULAR @"pdp_ip0" | |
#define IOS_WIFI @"en0" | |
#define IOS_VPN @"utun0" | |
#define IP_ADDR_IPv4 @"ipv4" | |
#define IP_ADDR_IPv6 @"ipv6" | |
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 <ifaddrs.h> | |
#import <arpa/inet.h> | |
// Get IP Address | |
- (NSString *)getIPAddress { | |
NSString *address = @"error"; | |
struct ifaddrs *interfaces = NULL; |
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
// Generated by CashLee | |
var domains = { | |
"cloudfront.net":1, | |
"w.org":1, | |
"ghost.io":1, | |
"mozilla.org":1, | |
"docker.io":1, | |
"kitematic.com":1, | |
"docker.com":1, |
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
function getParameter( name, url ) { | |
if (!url) url = location.href | |
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | |
var regexS = "[\\?&]"+name+"=([^&#]*)"; | |
var regex = new RegExp( regexS ); | |
var results = regex.exec( url ); | |
return results == null ? null : results[1]; | |
} | |
getParameter('q', 'hxxp://example.com/?q=abc'); |
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
for F in *.png ; | |
do cp $F ${F%@2x.png}.png; | |
done |
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 | |
if [ ! -n "$1" ] | |
then | |
echo "error!! repository is none" | |
else | |
mkdir $1 | |
echo "build a new repository : $1" | |
cd $1 && git --bare init && chown -vR git objects refs/heads | |
echo "complete" | |
fi |
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
<?php | |
function sinaWburl2ID($url) { | |
$surl[2] = str62to10(substr($url, strlen($url) - 4, 4)); | |
$surl[1] = str62to10(substr($url, strlen($url) - 8, 4)); | |
$surl[0] = str62to10(substr($url, 0, strlen($url) - 8)); | |
$int10 = $surl[0] . $surl[1] . $surl[2]; | |
return ltrim($int10, '0'); | |
} |
NewerOlder