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
echo $(svn status -v | awk '/^ *[0-9]* *[0-9]* .*$/ {if(REV<$2) REV=$2} END{print REV}') |
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
// twat.d.ts | |
declare module "twat" { | |
var client: Twitter.Client; | |
export = client; | |
} | |
declare module Twitter { | |
interface AuthParams { |
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
// kue.d.ts | |
///<reference path='../node/node.d.ts' /> | |
declare module "kue" { | |
import http = require('http'); | |
export var app: http.Server; | |
export var createQueue: (opts?: {redis?: any}) => Kue.Queue; | |
} |
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
interface Array<T> { | |
flatMap<E>(callback: (t: T) => Array<E>): Array<E> | |
} | |
Object.defineProperty(Array.prototype, 'flatMap', { | |
value: function(f: Function) { | |
return this.reduce((ys: any, x: any) => { | |
return ys.concat(f.call(this, x)) | |
}, []) | |
}, |
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
// | |
// Created by kaji on 15/08/17. | |
// | |
#ifndef JNIUTIL_JNIPARCEL_H | |
#define JNIUTIL_JNIPARCEL_H | |
#include <string> | |
#include <vector> | |
#include <memory> |
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
obj/ | |
gdb.setup | |
gdbserver |
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
# bridgebot.coffee | |
# | |
# Description: | |
# Bot for bridging channel with another Slack team. | |
qs = require 'querystring' | |
bridgeMessage = (robot, userid, username, text) -> | |
return unless text.length > 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
class CancellableDelayedTask { | |
var cancelled = false | |
func run(delay: Double, task: () -> Void ) { | |
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay)) | |
dispatch_after(time, dispatch_get_main_queue()) { [unowned self] () -> Void in | |
if !self.cancelled { | |
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
protocol ScopeFunc {} | |
extension ScopeFunc { | |
@inline(__always) func apply(block: (Self) -> ()) -> Self { | |
block(self) | |
return self | |
} | |
@inline(__always) func letIt<R>(block: (Self) -> R) -> R { | |
return block(self) | |
} | |
} |
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 android.graphics.PointF; | |
public class CurveHitTester { | |
private static final float FLT_EPSILON = 1.1920928955078125E-7f; | |
private static final float PI_2 = (float) Math.PI / 2.0f; | |
public static boolean hitTestLine(PointF point, PointF origin, PointF destination, float lineWidth) { | |
PointF[] vertices = new PointF[]{ origin, destination }; | |
return hitTestCurve(point, vertices, 1, lineWidth); |