stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CSS brushed metal by Simurai · CodePen</title> | |
<!-- | |
Copyright (c) 2012 Hugo Giraudel, http://codepen.io/HugoGiraudel | |
Permission is hereby granted, free of charge, to any person obtaining |
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
/************************************************** | |
* Basic program to check for primes (no optimisation) | |
* | |
* @author James Drew <[email protected]> | |
* @version 1.0 | |
* @since 10-11-2012 | |
*************************************************/ | |
class Prime | |
{ | |
public static void main (String[] 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 com.google.caliper.Runner; | |
import com.google.caliper.SimpleBenchmark; | |
import java.util.HashSet; | |
import java.util.TreeSet; | |
public class SetBenchmark extends SimpleBenchmark { | |
// If you add a main function, you can run it from your IDE. | |
public static void main(String[] args) throws Exception { | |
new Runner().run( |
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
<link rel="import" href="../ace-element/ace-element.html"> | |
<link rel="import" href="../core-input/core-input.html"> | |
<link rel="import" href="../paper-button/paper-button.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; |
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
r = new webkitSpeechRecognition; | |
r.continuous = true; | |
r.interimResults = true; | |
r.onresult = function(ev) { | |
console.log(ev.results[ev.results.length-1][0].transcript); | |
}; | |
r.start() |
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
# Start an HTTP server from a directory, optionally specifying the port | |
function server() { | |
local port="${1:-8000}" | |
open "http://localhost:${port}/" | |
# Set the default Content-Type to `text/plain` instead of `application/ | |
# And serve everything as UTF-8 (although not technically correct, this | |
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTP | |
} |
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
/* | |
Grep.js | |
Author : Nic da Costa ( @nic_daCosta ) | |
Created : 2012/11/14 | |
Version : 0.2 | |
(c) Nic da Costa | |
License : MIT, GPL licenses | |
Overview: | |
Basic function that searches / filters any object or function and returns matched properties. |
OlderNewer