Skip to content

Instantly share code, notes, and snippets.

@clayperez
clayperez / zebraRFID.js
Created November 22, 2013 01:27
ZEBRA COMMAND LINE RFID PRINT UTILITY Needs some cleanup work, but this handy script lets you execute simple print commands to a Zebra RFID printer that is connected to your computer.
///////////////////////////////////////
// RFID PRINTER COMMAND LINE UTILITY //
///////////////////////////////////////
// REQUIRES: node-printer by tojocky
// USAGE: node zebra.js <printer> <start> <end> <file.csv> <print/null>
//
// RANGE EXAMPLE prints range to screen only:
// C:> node zebra zebra 1 100
//
// RANGE EXAMPLE prints range:
@clayperez
clayperez / FAST-DOC-FRAGGING.markdown
Created December 19, 2014 07:03
FAST DOC FRAGGING

FAST DOC FRAGGING

A demonstration of faster DOM construction with docfrags. I decided to make it colorful.

A Pen by Carlos Perez on CodePen.

License.

<!-- EMBED INTO EACH FORM YOU ARE USING THIS FUNCTIONALITY WITH -->
<!-- MAKE SURE TO DISABLE THE FORM'S JQUERY FEATURE WHEN YOU GET THE EMBED CODE -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-beta1/jquery.min.js"></script>
<!-- ADD THE FOLLOWING JAVASCRIPT TO YOUR FORM'S EMBEDED CUSTOMIZATION -->
<script>
// FORMSTACK RADIO BUTTON AND SELECT BOX BEAUTIFICATION
// WORKS IN CONJUNCTION WITH THE CSS BELOW
// https://gist.github.com/clayperez/54547413ec23dff54fa6
jQuery(document).ready(function($){
'use strict';
///////////////////
// app.rhesus.io //
///////////////////
///
///
///
require('./config.js');
/////////////////
////////////////////////
/// PRIVILEGED ROUTES //
////////////////////////
///
///
///
module.exports = function(app,stormpath){
app.get('/dashboard', stormpath.loginRequired, function(req, res){
res.locals.stripeKey = process.env.STRIPE_PUBLISHABLE_KEY;
res.locals.user = req.user;
@clayperez
clayperez / parralaxVideo.html
Created July 11, 2016 22:38
Levi's GranFondo Parallax Video Background
<style>
.parallaxVideo{
opacity:0;
z-index:10;
min-width: 100%;
min-height: 100%;
/* Setting width & height to auto prevents the browser from stretching or squishing the video */
width: auto !important;
height: auto !important;
@clayperez
clayperez / morse.js
Created July 25, 2016 14:19 — forked from eholk/morse.js
A Morse Code generator in Java Script
function MorseNode(ac, rate) {
// ac is an audio context.
this._oscillator = ac.createOscillator();
this._gain = ac.createGain();
this._gain.gain.value = 0;
this._oscillator.frequency.value = 750;
this._oscillator.connect(this._gain);
@clayperez
clayperez / timeshift.js
Created September 29, 2016 03:46
Time shift function to take an array of times and shift them. Works with Rhesus too.
// timeshift.js
// node timeshift --file='newEvent.rhesus' --shift=+3000 --last
// node timeshift --file='lgf.starts.json' --shift=+690000
console.log('\nTIMESHIFT.JS');
console.log('> Automatically works with simple times or entire rhesus files.\n');
let argv = require('yargs').argv;
if (!argv.file) {
@clayperez
clayperez / fs-hacker.markdown
Last active February 6, 2017 17:44
FS Hacker
@clayperez
clayperez / join
Created September 23, 2017 20:57
JOIN CSV FILES
#!/bin/bash
DATETIME=$(date +%Y%m%d)
echo "MOVE ALL CSV FILES INTO A SINGLE FILE."
echo "join [outputfile]"
mkdir output
mkdir ./output/$1_$DATETIME
cat *.csv >./output/$1_$DATETIME.csv
mv *.csv ./output/$1_$DATETIME
open ./output