Skip to content

Instantly share code, notes, and snippets.

@karlbright
karlbright / pop-stripe.md
Created July 19, 2012 04:38
Rainbow stripe mixin with SCSS + Compass

Rainbow stripe mixin with SCSS + Compass

Usage

div
  height: 100px
  width: 100px

div.rainbow-1
@media screen and (max-width: 970px) {
body { background: red !important: } /* example */
.bjs-branding { display: none; }
}
@for $hue from 1 through 359
.hue-#{$hue}
background: hsl($hue, 62%, 55%)
border-color: hsl($hue, 62%, 49%)
class Stylesheet < ActiveRecord::Base
LATEST_TEMPLATE_VERSION = '1.0'
TEMPLATE_PATH_ROOT = Rails.root.join 'app', 'assets', 'whatlock'
TEMPLATE_BASE_FILENAME = 'whatlock.css.sass.erb'
EXPORT_PATH_ROOT = Rails.root.join 'public', 'stylesheets'
attr_accessible :author, :options, :primary_color, :version
Agworld.bindInputUpdateToElement = function (input, element) {
input = $(input);
element = $(element);
if (input.length > 0 && element.length > 0) {
input.keypress(function () {
var data = input.data();
if (data.timer !== undefined) {
clearTimeout(data.timer);
}
data.timer = setTimeout(function () {
@karlbright
karlbright / 16step.coffee
Created December 7, 2012 03:03 — forked from peterc/16step.coffee
Simple 16 step drum machine using CoffeeScript and Node
# Simple 16 step drum machine experiment with Node and CoffeeScript
# by Peter Cooper - @peterc
#
# Inspired by Giles Bowkett's screencast at
# http://gilesbowkett.blogspot.com/2012/02/making-music-with-javascript-is-easy.html
#
# Screencast demo of this code at http://www.youtube.com/watch?v=qWKkEaKL6DQ
#
# Required:
# node, npm and coffee-script installed
@for $i from 1 through 6
$table-width: 1190px
&.samples_#{$i}
thead th
width: ($table-width - 150px) / $i
&:first-child
width: 150px
@function rainbow($position, $colors) {
$colors: if(type-of($colors) != 'list', compact($colors), $colors);
$gradient: compact();
$width: 100% / length($colors);
@for $i from 1 through length($colors) {
$pop: nth($colors,$i);
$new: $pop ($width * ($i - 1)), $pop ($width * $i);
$gradient: join($gradient, $new, comma);
}
"---------------------------------------------------"
" Author: Karl Brightman "
" Homepage: http://karlbrig.ht "
" Source: http://github.com/karlbright/vimrc "
"---------------------------------------------------"
" vim:set ts=2 sts=2 sw=2 expandtab:
autocmd!
filetype off "Turn off file type detection. Required for Vundle
$('#search').keyup(function () {
var searchField = $('#search').val();
var regExp = new RegExp(searchField, 'i');
$.getJSON('data.json', function (data) {
var results = [];
var output = $('<ul>').addClass('output');
var results = $.map(data, function(value, key) {