Skip to content

Instantly share code, notes, and snippets.

View Echooff3's full-sized avatar

Echooff3 Echooff3

  • South of heaven
View GitHub Profile
@Echooff3
Echooff3 / gist:30e0c7771d16a08fea16
Created July 6, 2015 17:17
Fix node permissions
sudo chown -R $(whoami) ~/.npm
@Echooff3
Echooff3 / grunt.txt
Created August 3, 2015 16:25
Quickie Beanstalk setup
copy: {
dist: {
files: [
// includes files within path
{
flatten: true,
expand: true,
src: ['<%= pkg.src %>/*'],
dest: '<%= pkg.dist %>/',
filter: 'isFile'
@Echooff3
Echooff3 / freakydeeky.js
Created August 11, 2015 20:25
Kill all intervals on page
var highestTimeoutId = setTimeout(";");
for (var i = 0 ; i < highestTimeoutId ; i++) {
clearTimeout(i);
}
@Echooff3
Echooff3 / index.html
Created April 12, 2016 20:25 — forked from anonymous/index.html
React Sliding React Slider Example // source http://jsbin.com/fazuzi
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="React Slider Example">
<meta charset="utf-8" />
<title>React Sliding</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.1/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.1/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
using System;
public class InterpolatedInt
{
private float _currentValue = 0.0f;
private float _targetValue = 0.0f;
private float _percent = 1.0f;
public float easingValue = 0.25f;
public InterpolatedInt ()
{
}
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="reset.css" type="text/css" media="screen">
<style type="text/css" media="screen">
/**
* Your utility library for express
*/
var basicAuth = require('basic-auth');
/**
* Simple basic auth middleware for use with Express 4.x.
*
* @example
@Echooff3
Echooff3 / sort.js
Created July 6, 2017 20:55
XOR Sort
let x = Array.from(new Array(10), () => {return (Math.random() * (20 - 1) + 1) | 0})
const _xorSort = (x) => {
for( i = 0; i < x.length; i++) {
for( j = 0; j < x.length; j++) {
if(x[i] < x[j]) {
x[i] = x[i] ^ x[j]
x[j] = x[i] ^ x[j]
x[i] = x[i] ^ x[j]
}
@Echooff3
Echooff3 / csvtest.js
Created July 25, 2017 23:01
Parsing CSV with writeable buffer
const request = require('request')
const stream = require('stream')
const buffer = require('buffer')
class CSVStream extends stream.Writable {
constructor() {
super()
this._count = 0
this._buff = ""
this._push = (x) => {
//TODO figure out whether to dedup here or on DB Side