Skip to content

Instantly share code, notes, and snippets.

@sausman
sausman / CyaSS.jsx
Created Feb 21, 2015
CyaSS React Component - mimic :hover and :active with inline styles
View CyaSS.jsx
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
View gist:7933760
<%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 Dec 18, 2015
Example WhipUps Handlebars data by action name.
View archive.json
{
"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 Dec 18, 2015
WhipUps Default Theme
View layout.html
<!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'>
View gist:4629516
AuthType Basic
AuthUserFile .htpasswd
AuthName "Members Area"
Require valid-user
@sausman
sausman / gist:3360630
Created Aug 15, 2012
Sublime Text 2 prefs
View gist:3360630
{
"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,
View gist:3360637
<?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>
View .bash_profile PS1
export PS1="\[\e[1;30m\]\$\[\e[m\] "
View gist:711418
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')
View gist:b9c2563acd0a0b4b96b0
// 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");