Skip to content

Instantly share code, notes, and snippets.

View aweary's full-sized avatar
🌐
doing things and stuff

Brandon Dail aweary

🌐
doing things and stuff
View GitHub Profile
@aweary
aweary / tobinary.js
Created January 28, 2015 23:58
Add a toBinary() method to all numbers
Number.prototype.toBinary = function(){
return parseInt(this.toString(2));
};
// > (55).toBinary()
// > 110111
anonymous
anonymous / config.json
Created May 14, 2015 17:53
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@jquense
jquense / jsx-mode.js
Last active October 17, 2015 05:40
An attempt at a jsx CodeMirror mode
/*global CodeMirror */
function indexOf(string, pattern, from) {
if (typeof pattern === "string") {
var found = string.indexOf(pattern, from);
return found;
}
var m = pattern.exec(from ? string.slice(from) : string);
return m ? (m.index + from) : -1;
}
type floatPointType = {x: float, y: float};
type intPointType = {x: int, y: int};
type wCoordType =
| WCoord floatPointType;
type gCoordType =
| GCoord intPointType;
@clumma
clumma / BetterParts.md
Last active February 26, 2017 04:24
JavaScript: The Better Parts
@aweary
aweary / git-upstream.sh
Created February 27, 2017 16:30
Add an upstream remote quickly for Github repos
#! /usr/bin/env bash
# Quickly add an upstream remote repo from Github.
git_dir_path=`git rev-parse --show-toplevel`
repo_name=`basename ${git_dir_path}`
echo "Setting upstream to ${1}/${repo_name}"
git remote add upstream https://github.com/"$1"/"$repo_name".git
// put this at the top of your app
const setState = Component.prototype.setState
Component.prototype.setState = function(nextState) {
console.group(this.constructor.name)
console.trace()
if (this.shouldComponentUpdate) {
console.log('shouldComponentUpdate', (
this.shouldComponentUpdate(this.props, nextState)
))
}
@dobesv
dobesv / ReadMe.md
Last active July 31, 2018 16:37
Login script for custom auth0 database to auth via WordPress XML-RPC

You must provide the following configuration variables:

  1. WP_XMLRPC_URL = https://www.yourdomain.com/xmlrpc.php (replace with your domain and use http:// if you don't have SSL support)
  2. WP_ADMIN_USER = admin (use your own admin username)
  3. WP_ADMIN_PASSWORD = somepassword (use your own admin password)
@bevacqua
bevacqua / books.md
Last active October 13, 2018 16:52
Books I plan on buying this week

Web Performance

  • High Performance Web Sites: Essential Knowledge for Front-End Engineers
  • High Performance JavaScript (Build Faster Web Application Interfaces)
  • Even Faster Web Sites: Performance Best Practices for Web Developers
  • Designing for Performance: Weighing Aesthetics and Speed

Web Design

  • Adaptive Web Design: Crafting Rich Experiences with Progressive Enhancement (2nd Edition) (Voices That Matter)
--- Raw source ---
function add(a, b){
return a + b;
}
print(add(15, 19));
for (var i=0;i<1000;i++){
add(i, 22);
}