Skip to content

Instantly share code, notes, and snippets.

View drifterz28's full-sized avatar

Chris Whitney drifterz28

View GitHub Profile
@drifterz28
drifterz28 / something
Created March 30, 2015 17:36
spliting numbers in c++
// Example program
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
// declaring variables:
int a, remainder;
int result, result2, result3;
@drifterz28
drifterz28 / testservo.h
Created January 20, 2015 19:19
servo code found on g+
#include <SoftwareServo.h>
SoftwareServo myServo0; //create a servo object.
void setup() {
myServo0.attach(0); //attach the servo to pin 0 on Trinket
myServo0.write(90); // tell servo to go to position per quirk on arduino.cc
delay(15); // waits 15ms for the servo to reach the position
SoftwareServo::refresh();
}
@drifterz28
drifterz28 / debounce.js
Last active August 29, 2015 14:12
Throttle and debounce from underscore.js
/**
* @func function, a function to fire
* @wait int, wait time
* immediate bool, call function first then set timer
*/
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
@drifterz28
drifterz28 / base64_gif
Created November 26, 2014 17:56
transparent base64 gif image
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
@drifterz28
drifterz28 / clock.html
Last active August 29, 2015 14:10
animated clock
<div class="clock">
<div class="min_hand"></div>
<div class="center"></div>
<div class="hour_hand"></div>
</div>
@drifterz28
drifterz28 / label.html
Last active August 29, 2015 14:10
label show on focus
<style>
.input_wrapper {
position: relative;
margin-top: 24px;
float: left;
width: 100%;
margin-bottom: 20px;
}
input {
position: absolute;
@drifterz28
drifterz28 / firework.svg
Created November 11, 2014 23:53
firework svg with animated css
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head></head>
<body>
<select name="test_name" id="test_options">
<option>test 1</option>
<option>test 2</option>
<option>test 3</option>
</select>
{
"browser" : false,
"curly" : true,
"eqeqeq" : true,
"eqnull" : true,
"indent" : 4,
"latedef" : true,
"noarg" : true,
"strict" : false,
"trailing" : true,
@drifterz28
drifterz28 / add-files to new-context menu
Last active August 29, 2015 14:07
New computer windows setup
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.js\ShellNew]
"NullFile"=""
[HKEY_CLASSES_ROOT\.html\ShellNew]
"NullFile"=""
[HKEY_CLASSES_ROOT\.css\ShellNew]
"NullFile"=""