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
on run {input, parameters} | |
set filename to POSIX path of input | |
set cmd to "clear;cd `dirname " & filename & "`;vim " & quote & filename & quote | |
tell application "iTerm" | |
create window with default profile | |
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 wxlive_imageWithTineColor(tintColor:UIColor, | |
blendMode:CGBlendMode = .DestinationIn) -> UIImage{ | |
UIGraphicsBeginImageContextWithOptions(self.size, false, 0.0) | |
tintColor.setFill() | |
let bounds = CGRectMake(0.0, 0.0, self.size.width, self.size.height) | |
UIRectFill(bounds) | |
self.drawInRect(bounds, blendMode: blendMode, alpha: 1.0) | |
if blendMode != .DestinationIn { |
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
// | |
// NetworkInterface.c | |
// wxlive | |
// | |
// Created by 秦 道平 on 16/8/3. | |
// Copyright © 2016年 秦 道平. All rights reserved. | |
// | |
#include "NetworkInterface.h" | |
#include <sys/types.h> |
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
// | |
// AWPromise.swift | |
// AWHttpRequest | |
// | |
// Created by 秦 道平 on 16/5/8. | |
// Copyright © 2016年 秦 道平. All rights reserved. | |
// | |
import Foundation |
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
# -*- coding: utf-8 -*- | |
import tornado.ioloop | |
from tornado.httpclient import AsyncHTTPClient | |
import functools | |
task_list = [] | |
def callback(gen,task,v): | |
#print gen | |
#print task |
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
// | |
// SQLiteDB.swift | |
// SQLiteDB | |
// | |
// Copyright (c) 2014 Matt Donnelly | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
// | |
// Macros.swift | |
// | |
// Created by Xavier Muñiz on 6/12/14. | |
import Foundation | |
// dLog and aLog macros to abbreviate NSLog. | |
// Use like this: |
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
result = { | |
'a': lambda x: x * 5, | |
'b': lambda x: x + 7, | |
'c': lambda x: x - 2 | |
}.get(value,'') |
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
[CATransaction begin]; | |
[CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; | |
self.transform=WKFlipCATransform3DPerspectSimpleWithRotate(rotateDegree); | |
... | |
[CATransaction commit]; |
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
double startTime=CFAbsoluteTimeGetCurrent(); | |
NSLog(@"duration:%f",CFAbsoluteTimeGetCurrent()-startTime); |
NewerOlder