This file contains hidden or 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 os | |
result = {"":0} | |
for root, dirs, files in os.walk(".", topdown=False): | |
for name in files: | |
path = os.path.join(root, name) | |
ext = os.path.splitext(name)[1] | |
if ext == ".swift": | |
f = open(path, "r") |
This file contains hidden or 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 a = 1 | |
var b = 1 | |
//Do not capture | |
let add1 = { | |
print(a+b) | |
} | |
add1() //2 | |
a = 2 | |
b = 3 |
This file contains hidden or 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
API_KEY=123456 | |
for f in "$@" | |
do | |
JSON=$(curl --user api:$API_KEY --data-binary "@$f" -i https://api.tinify.com/shrink) | |
RESULT=${JSON##*url\":\"} | |
RESULT=${RESULT%%\"\}\}} | |
IMAGE=${f%.*}_tinypng.${f##*.} | |
curl "$RESULT" -o "$IMAGE" |
This file contains hidden or 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
nodePath="https://nodejs.org/dist/v4.4.7/node-v4.4.7-linux-x86.tar.xz" | |
tmpPath="tmpnode" | |
mkdir $tmpPath | |
cd $tmpPath | |
wget $nodePath | |
xz -z *.tar.xz | |
tar -xvf *.tar | |
cd "node-v4.4.7-linux-x86" |
This file contains hidden or 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 UIKit | |
class Person:NSObject | |
{ | |
var name:String! | |
init(name:String){ | |
self.name = name | |
println("init \(name)") | |
} |
This file contains hidden or 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
// | |
// UIView+ZXPop.h | |
// sdhgasdgf | |
// | |
// Created by 张玺 on 14-9-1. | |
// Copyright (c) 2014年 zhangxi.me. All rights reserved. | |
// | |
#define kZXPopBlurImageTag -5531 | |
#define kZXPopBlurViewTag -5532 | |
#define kZXPopViewTag -5533 |
This file contains hidden or 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
#coding:utf-8 | |
#!/usr/bin/python | |
import Queue | |
import threading | |
import os | |
import time | |
import random | |
import urlparse,urllib,urllib2,os,time,threading,Queue | |
from bs4 import BeautifulSoup |
This file contains hidden or 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
#coding:utf-8 | |
#!/usr/bin/python | |
import urlparse,urllib,urllib2,os | |
from bs4 import BeautifulSoup | |
print "======start======" | |
print "./dbmeizi" | |
def downloadImage(imageURL): | |
url = urlparse.urlparse(imageURL) |
This file contains hidden or 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
#coding:utf-8 | |
#!/usr/bin/python | |
import getopt,sys,urlparse,urllib2,json | |
def getAPI(theURL): | |
jsonString=urllib2.urlopen(theURL).read() | |
page = json.dumps(json.loads(jsonString),indent=4) | |
page = " "+page.replace("\n","\n ") |
This file contains hidden or 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 Cocoa | |
class Human:NSCopying | |
{ | |
var name = ".." | |
var spouse:Human? | |
func copy() -> AnyObject! { |
NewerOlder