Skip to content

Instantly share code, notes, and snippets.

View oupo's full-sized avatar

oupo oupo

  • Japan
View GitHub Profile
@oupo
oupo / gist:9309453
Last active August 29, 2015 13:56
A vimperator script to show bookmarks with sorting by date added.
:js <<EOF
let bookmarksService = services.get("bookmarks");
let bookmarks = storage["bookmark-cache"].bookmarks;
let idToDate = Object.create(null);
for (let item of bookmarks) {
idToDate[item.id] = bookmarksService.getItemDateAdded(item.id);
}
completion.listCompleter(function(context, tags, extra) {
completion.bookmark(context, tags, extra);
context.compare = function (a,b) (idToDate[b.item.id] - idToDate[a.item.id]);
@oupo
oupo / gist:9325027
Last active August 29, 2015 13:56
gist検索
// あらかじめ<data:text/html,>なんかを開いておいてFirebug上で実行する
include("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"); // この行だけ単独で先に実行すること
let N = 5;
let USER = "mattn";
function pred(x) Object.keys(x.files).some(function (n) /\.go/.test(n));
function loop(n) {
if (n > N) return;
@oupo
oupo / sub.ts
Last active August 29, 2015 13:57
2つのTypeScriptファイルを連結して、1つのNode用JSファイルにしたい。tsc t.js --module commonjs --out out.js としてみると出力にt.tsの2行がない
module sub {
export function x() {
console.log("x");
}
function y() {
console.log("y");
}
}
@oupo
oupo / gist:9378944
Created March 5, 2014 23:26
cut affiliate id from amazon link
javascript:for(x%20of%20document.links)x.href=(x.getAttribute("data-expanded-url")||x.href).replace(/[\w\-]+-22/g,"");void 0
class Test {
public function new() {}
static function main(){
var x = new Map<Test, Int>();
x[new Test()] = 1;
}
}
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <algorithm>
#include "litestring.h"
static int firstCapa(int len) {
return len == 0 ? 64 : (len + 63) & ~63;
}
class Set<K> {
var map: Map<K,Bool>;
public function new() {
this.map = new Map<K,Bool>();
}
public function add(k:K): Void {
this.map.set(k, true);
}
public function has(k:K): Bool {
require "set"
def main
# 関数の引数はすべて参照渡しということにする
@program = [
[:sub, :main, [],
[:f, :a]],
[:sub, :f, [:x],
[:set!, :a],
[:g, :x]],
Index: desmume/src/lua-engine.cpp
===================================================================
--- desmume/src/lua-engine.cpp (リビジョン 5048)
+++ desmume/src/lua-engine.cpp (作業コピー)
@@ -1124,6 +1124,24 @@
}
+extern TimeSpan HIJACK_TIME_DIFF;
+