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
server { | |
listen 80; | |
server_name konklone.com; | |
return 301 https://$host$request_uri; | |
} | |
# optional: the 'spdy' at the end of the listen command below turns on SPDY support. | |
server { | |
listen 443 ssl spdy; |
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
// this will optimize-deoptimize leading to v8 giving | |
// up on the function | |
String.prototype.hashCode = function() { | |
var n = this.length; | |
var hash = 0; | |
if(n != 0) { | |
for(var i = 0; i < n; ++i) | |
hash = Math.imul(31, hash) + this.charCodeAt(i) | 0; | |
return hash; |
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
// what does the following code print? | |
// | |
// a) false, true | |
// b) true, true | |
// c) true, false | |
// d) none of the above | |
console.log(new Option() instanceof HTMLOptionElement) | |
console.log(new HTMLOptionElement() instanceof HTMLOptionElement) |
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
// http://jsperf.com/double2int | |
function double2int=function(x){ | |
if(isNaN(x)) | |
return 0; | |
if(x==Infinity||x>0x7fffffff) | |
return 0x7fffffff; | |
if(x==-Infinity||x<-0x80000000) | |
return -0x80000000; | |
return x|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
// java source | |
public static void main(String[] args) { | |
for(int i = 0; i < 10; ++i) { | |
System.out.println(Color.normalize(255)); | |
System.out.println(i); | |
} | |
} | |
// defrac js | |
main = function(args){ |
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 java.lang.reflect.Constructor; | |
import java.util.Arrays; | |
import java.util.List; | |
public final class Foo { | |
public static void main(String[] args) { | |
final Constructor<?>[] ctors = A.class.getDeclaredConstructors(); | |
for(Constructor<?> ctor : ctors) { | |
System.out.println(Arrays.toString(ctor.getParameterTypes())); | |
System.out.println(Arrays.toString(ctor.getGenericParameterTypes())); |
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
//lift version 2.3-M1 | |
object ErrorSnippet extends DispatchSnippet { | |
val showBug = true | |
def dispatch = { | |
case _ => bug | |
} | |
def bug = { | |
val id = nextFuncName |
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
// #1 Launch Chrome | |
// #1.1 If you are on the Beta channel you are fine | |
// #1.2 If you are not on the Beta channel enable Web Audio API in about:flags | |
// #2 Ctrl+Shift+C or Apple+Shift+J | |
// #3 Open Console | |
// #4 Paste | |
var bufferSize = 2048 | |
var ctx = new webkitAudioContext() | |
var js = ctx.createJavaScriptNode(bufferSize, 0, 1) | |
var phase = 0.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
// the difference between ceylon and scala | |
// | |
shared | |
class Polar(Float angle, Float radius) { | |
shared | |
Float angle = angle; | |
shared | |
Float radius = radius; |
OlderNewer