Skip to content

Instantly share code, notes, and snippets.

View jdrew1303's full-sized avatar
probably drinking coffee

James Drew jdrew1303

probably drinking coffee
View GitHub Profile
@jdrew1303
jdrew1303 / index.html
Created November 15, 2012 17:18 — forked from pixbit/index.html
CSS brushed metal
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS brushed metal by Simurai &middot; CodePen</title>
<!--
Copyright (c) 2012 Hugo Giraudel, http://codepen.io/HugoGiraudel
Permission is hereby granted, free of charge, to any person obtaining
@jdrew1303
jdrew1303 / Prime.java
Created November 24, 2012 00:23
Calculating Primes
/**************************************************
* 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)
@jdrew1303
jdrew1303 / 0_reuse_code.js
Created March 25, 2014 10:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
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(
@jdrew1303
jdrew1303 / designer.html
Created January 25, 2015 03:38
designer
<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;
@jdrew1303
jdrew1303 / recog.js
Last active August 29, 2015 14:22 — forked from addyosmani/recog.js
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()
# 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
}
@jdrew1303
jdrew1303 / Readme.md
Last active August 29, 2015 14:22 — forked from addyosmani/Readme.md

stopBefore.js

2min screencast

Examples

stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')
@jdrew1303
jdrew1303 / Grep.js
Last active August 29, 2015 14:22 — forked from addyosmani/Grep.js
/*
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.

#If you're on Ubuntu or working with a Linux VM...

Step 1: Install the Ubuntu dependencies needed:

SSH into your server as a root or do sudo -i.

Then install necessary software:

apt-get update