Skip to content

Instantly share code, notes, and snippets.

View prettydiff's full-sized avatar
💭
Home from military deployment

Austin Cheney prettydiff

💭
Home from military deployment
View GitHub Profile
var List = React.createClass({
renderList: function () {
return this.props.items.map(function (item) {
return <ListItem item={value} key={keyvalue.id} />;
});
},
render: function () {
return <ul className="List">
this.renderList()
@prettydiff
prettydiff / gist:8682c3a4bbaadd1a0fe0103f1ad65c98
Last active March 18, 2018 11:50
color cycle text for the commandline
function changeColor(str) {
const arr = str.split("");
let a = arr.length - 1,
b = 8;
do {
arr[a] = `\u001b[3${b}m${arr[a]}`;
a = a - 1;
b = b - 1;
if (b < 1) {
window.parseFramework={language:function framework_language(){"use strict";return},lexer:{},parse:{},parseerror:"",parser:function framework_parser(){"use strict";return}};/*
Parse Framework
*/
/*jslint node:true */
/*eslint-env node*/
/*eslint no-console: 0*/
/*global global, location*/
(function parse_init() {
"use strict";
let framework;
users.put('/users/:id', (req, res, next) => {
function validateAuthentication(userId) {
if (userId) {
throw Unauthenticated('You have to log in');
}
}
function ValidateOtherPermission(user) {
const hasPermission = checkPermission({
actualRole: user.Role,
@prettydiff
prettydiff / index.html
Created July 11, 2017 18:35
dom walking versus querySelector - 3 (http://jsbench.github.io/#19326344341cbc33122e0e8fbbd21b5a) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>dom walking versus querySelector - 3</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@prettydiff
prettydiff / index.html
Created July 11, 2017 15:53
dom walking versus querySelector - 2 (http://jsbench.github.io/#ae7713b7b1db5878d60ecd1f827e091d) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>dom walking versus querySelector - 2</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@prettydiff
prettydiff / index.html
Created July 11, 2017 15:50
dom walking versus querySelector - 1 (http://jsbench.github.io/#24d619b25e826b4d2914a138ce9eb274) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>dom walking versus querySelector - 1</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@prettydiff
prettydiff / index.html
Created July 11, 2017 15:46
dom walking versus querySelector (http://jsbench.github.io/#8f4021c69ba67f37953e5d0236d596df) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>dom walking versus querySelector</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@prettydiff
prettydiff / gist:0e2a3cfd1a494e1afb0e762df85d2163
Created November 21, 2016 13:54
jslint line number error
/*jshint laxbreak: true*/
/*jslint node: true, for: true*/
(function biddle() {
"use strict";
var node = {
child: require("child_process").exec,
fs: require("fs"),
http: require("http"),
https: require("https"),
path: require("path")
[Enter steps to reproduce below:]
1. ...
2. ...
**Atom Version**: 1.10.2
**Electron Version**: 0.37.8
**System**: Mac OS X 10.11.6
**Thrown From**: Atom Core