Skip to content

Instantly share code, notes, and snippets.

@zakki
zakki / holderko.js
Created October 30, 2014 06:38
holder.js with knockout.js
ko.bindingHandlers["holderJs"] = {
init: function (element, valueAccessor) {
var value = valueAccessor();
$(element).attr("data-src", ko.unwrap(value));
Holder.run({ images: element });
}
};
class A {
public a() {
alert("A!");
}
}
class B extends A {
public b() {
alert("B!");
}
}
//from http://yosuke-furukawa.hatenablog.com/entry/2014/07/31/093041
$traceurRuntime.ModuleStore.getAnonymousModule(function() {
"use strict";
var $__2 = $traceurRuntime.initGeneratorFunction(fibonacci);
function fibonacci() {
var fn1,
fn2,
current;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
[ /'//*' ] && exec cscript -E:jscript -nologo `cygpath -w $0` $* #*/ ] ;
var spVoice = WScript.CreateObject("SAPI.SpVoice");
var args = WScript.Arguments;
for (i = 0; i < args.length; i++) {
spVoice.Speak(args(i));
}
class A {
private m = 123;
func(ev: Event) {
console.log(this);
console.log(this.m);
}
}
var a = new A();
RewriteEngine on
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule .+ %{REQUEST_URI}.gz
<FilesMatch "\.js\.gz$">
ForceType application/x-javascript
AddEncoding x-gzip .gz
</FilesMatch>
class type _JQueryAjaxSettings = object
method accepts : Ts.any Js.prop
method async : Ts.typeReference Js.prop
method beforeSend : (Ts.typeReference -> Ts.typeReference -> Ts.any) Js.prop
method cache : Ts.typeReference Js.prop
method complete : (Ts.typeReference -> Ts.string -> Ts.any) Js.prop
method contents : Ts.typeLiteral Js.prop
method contentType : Ts.string Js.prop
method context : Ts.any Js.prop
method converters : Ts.typeLiteral Js.prop
int code_execcmd( void )
{
//...
try {
while(1) {
if ( GetTypeInfoPtr( type )->cmdfunc( val ) ) { // タイプごとの関数振り分け
if ( hspctx->runmode == RUNMODE_RETURN ) {
cmdfunc_return();
} else {
hspctx->msgfunc( hspctx );
// http://d.hatena.ne.jp/nowokay/20140330#1396177524
import java.util.*;
import java.util.function.*;
import java.util.stream.*;
public class LoopBench2 {
public static void main(String[] args) {
List<Integer> list = IntStream.range(0, 100_000).boxed().collect(Collectors.toList());
array = list.toArray(new Integer[0]);
for (int i = 0; i < 10; i++) {
public class Nan {
static void f(double a) {
long t0 = System.nanoTime();
double acc = a;
for (int i = 0; i < 100000000; i++) {
acc += i;
}
long t1 = System.nanoTime();
System.out.println("time:" + (t1 - t0) / 1000000 + " " + acc);