Skip to content

Instantly share code, notes, and snippets.

View kylefritz's full-sized avatar

Kyle Fritz kylefritz

View GitHub Profile
@kylefritz
kylefritz / HandlebarsBundleTransform.cs
Created July 6, 2012 13:54
Compile Handlebars Templates in .net mvc
using System.IO;
using System.Text;
using System.Web;
using System.Web.Optimization;
using Jurassic;
using System.Globalization;
namespace Fewt.Web
{
@kylefritz
kylefritz / gist:3105454
Created July 13, 2012 15:23
quick and easy extension changing
for i in *.css;
do mv $i ${i%%.css}.less;
done
@kylefritz
kylefritz / gz-css-and-js.sh
Created September 5, 2012 15:26
pack assets for cloudfront cdn
for css in $(ls ./*/*.css)
do
mv "$css" "$css.org"
gzip "$css.org" --stdout > "$css"
rm "$css.org"
done
for js in $(ls ./*/*.js)
do
mv "$js" "$js.org"
@kylefritz
kylefritz / patterns.js
Created November 19, 2012 15:43
winning regex patterns
/[ -~]/ //matches all ASCII characters from the space to the tilde (printable characters)
@kylefritz
kylefritz / ninject-console.cs
Created January 22, 2013 20:40
Ninject DI for console apps.
using System;
using System.Collections.Generic;
using System.Linq;
using Ninject;
using Ninject.Extensions.Conventions;
using Ninject.Extensions.Conventions.BindingGenerators;
class Program
{
static void Main(string[] args)
@kylefritz
kylefritz / delete-stations.js
Last active April 25, 2018 16:17
delete all the stations in pandora
function clickDelete(){
$('.deleteStation').delay(800).click();
console.log("deleted station")
if( $('.stationListItem').length > 2 ){
setTimeout(clickDelete, 5000);
}
}
clickDelete();
module IndecentExposure
extend ActiveSupport::Concern
module ClassMethods
private
def expose(name, &block)
var = "@#{name}"
define_method(name) do
instance_variable_set(var, instance_variable_get(var) || instance_eval(&block))
end
@kylefritz
kylefritz / relay_button.ino
Last active December 29, 2015 18:59
Arduino control of two relay shields
const int buttonPin = 8;
int buttonState = 0;
int relay_control_pins[] = {
2, //white (office)
3, //house
4, //downstairs building 2
5, //downstairs building 1
6 //work
};
@kylefritz
kylefritz / index.html
Last active December 30, 2015 04:29
Boiler Room Baltimore Video Overlay
<style type="text/css">
img, video{
position: absolute;
width: 100%;
}
img{
z-index: 100;
width: 70%;
margin: 0 15%;
}
@kylefritz
kylefritz / .pathrc
Last active January 1, 2016 13:09
pathrc file
#
# PATH
#
# current directory bin (and for bundler)
PATH="./bin:./.bundle/bin"
# my local bin
PATH+=":$HOME/local/bin"