Skip to content

Instantly share code, notes, and snippets.

View ryan-w-moore's full-sized avatar

Ryan W Moore ryan-w-moore

View GitHub Profile
@ericc3141
ericc3141 / elemzapper
Last active March 22, 2024 18:15
Bookmarklet to remove elements from pages.
javascript:if (typeof(zapper) == "undefined") {window.zapper = {state: 1,over: null,selected: null,select: function(e) {zapper.selected = document.elementFromPoint(e.clientX, e.clientY);zapper.over=document.createElement("div");zapper.over.style="pointer-events:none;position:fixed;z-index:2147483647;background-color:#FF0000;opacity:0.5;";document.body.appendChild(zapper.over);var rect = zapper.selected.getBoundingClientRect();var overS=zapper.over.style;overS.left = rect.left+"px";overS.top = rect.top+"px";overS.width = rect.width+"px";overS.height = rect.height+"px";zapper.state = 2;},zap: function(e) {var selected2 = document.elementFromPoint(e.clientX, e.clientY);if (zapper.selected == selected2){console.log("zapping");selected2.parentElement.removeChild(selected2);}document.body.removeChild(zapper.over);zapper.state=3;console.log("done");}}; document.body.addEventListener("click", function(e){e.preventDefault();console.log("click");if (zapper.state == 1){zapper.select(e);} else if (zapper.state == 2) {zap
@filmgirl
filmgirl / el-capitan-install-usb
Last active November 30, 2019 04:05
Create Bootable USB Drive for OS X El Capitan
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction
anonymous
anonymous / gist:402ab895a5410e4cd250
Created February 10, 2015 10:37
twist box · http://drbl.in/nJje
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
<?php
/*
Name - templated.php
Author - Shafiq Mustapa ([email protected])
Usage - php templated.php
Stumble this upon site (http://templated.co)that offer over 800+ HTML5 + CSS + Responsive.
This php script will download the file automatically. For now, the page is now 7.
Tools
@sicksand
sicksand / templated.php
Last active May 10, 2021 05:39
Stumble this upon site ( http://templated.co ) that offer over 800+ HTML5 + CSS + Responsive. This php script will download the file automatically. For now, the page is now 20.
<?php
/*
Name - templated.php
Author - Shafiq Mustapa ([email protected])
Usage - php templated.php
Stumble this upon site (http://templated.co)that offer over 800+ HTML5 + CSS + Responsive.
This php script will download the file automatically. For now, the page is now 7.
Tools
@spamwax
spamwax / eloquentjavascript_solutions_chapter_7.js
Created June 4, 2014 19:52
Solution to eloquentjavascript exercise second 2nd edition (Chapter 7) eloquent javascript
function Plant() {
this.energy = 3 + Math.random() * 4;
}
Plant.prototype.act = function(context) {
if (this.energy > 19) {
var space = context.find(" ");
if (space)
return {type: "reproduce", direction: space};
}
if (this.energy < 20)
@spamwax
spamwax / gist:99f1a2d9f21ed463d157
Last active November 22, 2017 22:34
Solution to eloquentjavascript exercise second 2nd edition (Chapter 5) eloquent javascript
// Solution to eloquentjavascript exercise second 2nd edition
// Chapter 5
// http://eloquentjavascript.net/2nd_edition/preview/05_higher_order.html
// Mother-child age difference
function average(array) {
function plus(a, b) { return a + b; }
return array.reduce(plus) / array.length;
}
@creationix
creationix / convert.js
Last active March 31, 2020 07:15
Convert a hex string (base-16) to a base-65536 (16-bit) string.
function hexToBase65536(hex) {
var result = "";
for (var i = hex.length ; i > 0; i -= 4) {
result += String.fromCharCode(parseInt(hex.substring(i - 4, i), 16));
}
return result;
}
@rpietro
rpietro / crafting_quality_code.md
Last active January 1, 2016 21:18
Crafting Quality Code

Crafting Quality Code

A few notes from Jennifer Campbell & Paul Gries' outstanding Coursera MOOC Crafting Quality Code

Recipe for designing functions

  1. examples
  2. type contract
  3. header
@rpietro
rpietro / simplified_dot_template.gv
Last active December 20, 2015 11:29
simplified dot template
digraph situated_schema {
name [color = red, style = filled]
rankdir=LR
"name" -> "name2"
}