Skip to content

Instantly share code, notes, and snippets.

View tripplyons's full-sized avatar

Tripp Lyons tripplyons

View GitHub Profile
@tripplyons
tripplyons / template.html
Last active May 9, 2017 17:08
HTML template
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Template</title>
<!-- Put your CSS below -->
<style>
h1 {
color: red;
@tripplyons
tripplyons / config.json
Created March 25, 2016 18:13
Bootstrap 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": "#ffc107",
"@brand-success": "#8bc34a",
function hex (c) {
var s = "0123456789abcdef";
var i = parseInt (c);
if (i == 0 || isNaN (c))
return "00";
i = Math.round (Math.min (Math.max (0, i), 255));
return s.charAt ((i - i % 16) / 16) + s.charAt (i % 16);
}
/* Convert an RGB triplet to a hex string */
#ifdef GL_ES
precision mediump float;
#endif
#extension GL_OES_standard_derivatives : enable
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
start = exps:(expr+) {
return exps.join('')
}
call = first:((func:function) / (identifier:id)) "(" exp:expr? ")" {
return first + "(" + exp + ")"
}
id = chars:([a-zA-Z]+) {
return chars.join('')
}
def = "#" identifier:id {
var iterations = 1000000;
console.time('Function #1');
for(var i = 0; i < iterations; i++ ){
functionOne();
};
console.timeEnd('Function #1')
console.time('Function #2');
for(var i = 0; i < iterations; i++ ){
functionTwo();
#f2c01d
#ed003a
#4f8900
@tripplyons
tripplyons / index.html
Created May 1, 2017 20:38
Stupid Timer
<div id="card"></div>
@tripplyons
tripplyons / handy.py
Created May 16, 2017 21:01 — forked from rainyear/handy.py
Hand posture detection with OpenCV.
#!/usr/bin/env python
import cv2
import numpy as np
def main():
cap = cv2.VideoCapture(0)
while(cap.isOpened()):
ret, img = cap.read()
skinMask = HSVBin(img)
@tripplyons
tripplyons / get.js
Created September 8, 2017 03:02
HTTP GET JavaScript
function get(url, cb) {
var xhr = new XMLHttpRequest()
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
cb(xhr.responseText)
}
}
xhr.open("GET", url, true) // true for asynchronous
xhr.send(null)
}