Skip to content

Instantly share code, notes, and snippets.

View tylerFowler's full-sized avatar

Tyler Fowler tylerFowler

  • LinkedIn
  • San Francisco, CA
View GitHub Profile
@tylerFowler
tylerFowler / sim.coffee
Created December 8, 2013 09:57
My rigid body rotation simulation for my Physics lab at the University of Kansas. Written in CoffeeScript, the simulation uses KineticJS (4.5.2 beta at the time of writing) and jQuery for graphics and animation.
### Model :
Physics Stuff : Equations and Helper Functions
Equations Used:
Center of Mass (x-axis only): Xcm = Sum((m_i*x_i)/Sum(mi))
Moment of Inertia of a Sphere: I = (2/5) * mass * radius^2
Gravitational Torque: T_grav = -(Sum(m_i)) * g_earth * DistToX_cm
###
# Global Constants:
WEIGHT_RADIUS = 30 #px
@tylerFowler
tylerFowler / atom_solarizeddark_stylesheet.less
Created December 7, 2014 23:47
My custom Atom text editor stylesheet for use with the Solarized Dark theme
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed.
*
* If you are unfamiliar with LESS, you can read more about it here:
* http://www.lesscss.org
*/
@tylerFowler
tylerFowler / upcase_first.ml
Created December 22, 2014 21:58
Example of OCaml `let .. in` constructs
let upcase_first_entry line =
let (first :: rest) = String.split ~on:',' line in
String.concat ~sep:","
(String.uppercase first :: rest)
;;
@tylerFowler
tylerFowler / nodejs_logger.coffee
Created January 19, 2015 02:16
Snippet for creating a custom logging system for NodeJS server applications
### Setup ###
# src/coffee/server/utlity/logger.coffee
colors = require 'colors' # npm install colors
config = require './config' # optional custo config manager (loads from config.json)
class Logger
constructor: (@moduleName) ->
getTimeString: ->
@tylerFowler
tylerFowler / atom_blue_solarized.less
Created February 9, 2015 06:56
Atom - Blue Solarized Styles
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed.
*
* If you are unfamiliar with LESS, you can read more about it here:
* http://www.lesscss.org
*/
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@tylerFowler
tylerFowler / sass_toolbox.scss
Created August 19, 2015 05:11
A handy list of sass mixins
.hidden { display: none; } // won't take up DOM space
.hide { opacity: 0; } // will take up DOM space
/// On Chrome an input click will outline the element in blue, turn this off
@mixin disable-focus-outline {
&:focus { outline: none; }
}
@mixin center-vertically {
position: relative;
[Unit]
Description=Clean Docker Daily
[Timer]
OnCalendar=daily
Unit=docker-janitor.service
[Install]
WantedBy=default.target
@tylerFowler
tylerFowler / main.go
Created January 15, 2018 17:00
consul-template-certdump
package main
import (
"io/ioutil"
"log"
"os"
"os/user"
"strconv"
)