Skip to content

Instantly share code, notes, and snippets.

View sausman's full-sized avatar

Stephen Ausman sausman

View GitHub Profile
@sausman
sausman / CyaSS.jsx
Created February 21, 2015 22:13
CyaSS React Component - mimic :hover and :active with inline styles
import React from "react/addons";
import m from "./m";
// https://www.youtube.com/watch?v=GOiVYbWJDOA
export default class CyaSS extends React.Component {
constructor() {
super();
this.state = {
hover: false,
active: false
@sausman
sausman / gist:7933760
Last active December 31, 2015 04:19 — forked from jayd3e/gist:7933710
<%def name="body()">
<p>
Hey Flunker! Your classes have been active while you&rsquo;ve been gone. Files have
been uploaded, students have helped other students. Get back to the
community, they&rsquo;re waiting for you.
</p>
<p>
-c<span style="color: red">F</span>
</p>
@sausman
sausman / archive.json
Last active December 18, 2015 07:19
Example WhipUps Handlebars data by action name.
{
"action": "archive",
"archive": {
"utc": "2013-06-01 00:00:00 UTC",
"timestamp": 1370044800,
"year": 2013,
"month": 6,
"month_padded": "06",
"month_name": "June",
"month_name_abbr": "Jun",
@sausman
sausman / layout.html
Last active December 18, 2015 07:19
WhipUps Default Theme
<!DOCTYPE html>
<html>
<head>
<title>{{#if title}}{{title}} - {{/if}}{{name}}</title>
<meta charset="utf-8">
{{#if avatar}}<link rel="icon" type="image/png" href="{{avatar_url}}">{{/if}}
<meta name="viewport" content="initial-scale=1, minimum-scale=1, maximum-scale=1">
<link rel="alternate" type="application/atom xml" title="Atom Feed" href="http://{{domain}}/feed">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto:500,700' rel='stylesheet' type='text/css'>
AuthType Basic
AuthUserFile .htpasswd
AuthName "Members Area"
Require valid-user
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Eric JK</string>
<!-- based on http://hcalves.deviantart.com/art/Mustang-Vim-Colorscheme-98974484 -->
<key>name</key>
<string>Mustang</string>
<key>settings</key>
@sausman
sausman / gist:3360630
Created August 15, 2012 14:33
Sublime Text 2 prefs
{
"color_scheme": "Packages/Color Scheme - Default/sausman.tmTheme",
"draw_indent_guides": true,
"ensure_newline_at_eof_on_save": true,
"font_face": "Menlo",
"font_size": 14.0,
"highlight_modified_tabs": true,
"tab_size": 2,
"theme": "Soda Dark.sublime-theme",
"translate_tabs_to_spaces": true,
export PS1="\[\e[1;30m\]\$\[\e[m\] "
require 'rubygems'
require 'yaml'
require 'rest-client'
require 'rails'
module Seat
# store default database as well as auth credentials in yaml file
CONFIG = YAML::load_file('config.yaml')
// Store $('body') and $('.mainMenu') in variables outside of the event handler
// This way they only need to be looked up once and not on every click
var $body = $('body');
var $mainMenu = $(".mainMenu");
$body.click(function(e){
// Since you're only checking the className you can use `hasClass` here instead of `is`
// http://jsperf.com/jquery-is-vs-hasclass
if ( $(e.target).hasClass("js-menuToggle") ) {
$mainMenu.toggleClass("mainMenu--visible");