Skip to content

Instantly share code, notes, and snippets.

View jescalan's full-sized avatar

Jeff Escalante jescalan

View GitHub Profile
@jescalan
jescalan / responsive.sass
Created February 13, 2012 22:11
responsive
=responsive($to)
@if $to == phone
@media only screen and (max-width: 479px)
@content
@else if $to == landscape
@media only screen and (min-width: 480px) and (max-width: 767px)
@content
@else if $to == tablet
@media only screen and (min-width: 768px) and (max-width: 959px)
@content
@jescalan
jescalan / split.sass
Created February 13, 2012 22:59
split 2
// Create a fluid content area. This should be used rather than floating and setting widths
// for increased flex. They can be rearranged with responsive queries later
=split($params)
@for $i from 1 to length($params) + 1
& > *:nth-child(#{$i})
float: left
width: nth($params, $i)
// Usage
@jescalan
jescalan / imgfade.coffee
Created February 23, 2012 21:59
imgfade
$.fn.imgFade = (time) ->
# set default time
time ?= 500
# wrap it
this.wrap("<div class='#{this.attr('class')}' />")
wrapper =
this
@jescalan
jescalan / arrays.js
Created February 23, 2012 23:20
Intro to arrays
// here's an array
arr = []
// here's some shit in an array
arr = ['some', 'shit']
// here's adding some shit to an array
arr.push('more shit')
// here's counting the number of things in an array
@jescalan
jescalan / setup.sh
Created April 6, 2012 20:56
Environment Setup
#!/bin/sh
# --------------------------------------------------------------------------------------
# Sets up your computer with the tools you need to develop in a modern ruby environment.
# --------------------------------------------------------------------------------------
# This install includes:
# - homebrew
# - rbenv
# - ruby-build
# - ruby 1.9.3-p125
@jescalan
jescalan / scramble.rb
Created April 26, 2012 22:15
Sensical sentence scrambler
# ---------------------------
# Sensical Sentence Scrambler
# ---------------------------
# This short program takes any word longer than three characters and randomly shuffles all the characters
# except for the first and the last. Strangely enough, sentences are still quite readable like this.
# **Usage**
# Save the file on your computer as 'scramble.rb'.
# From the command line, run `ruby scramble.rb "Here's my sentence!"`, and it should output
@jescalan
jescalan / example.styl
Created April 30, 2012 23:56
stylus example
hover-darken(percent)
if @background
&:hover
background: darken(@background, percent)
.test
background: blue
hover-darken(50%)
#!/bin/sh
# Installation instructions:
# - Download the file
# - mv finalize.sh finalize
# - chmod +x finalize
# - mv finalize /usr/local/bin
# - now you can type `finalize` in any directory and it should work
# NOTE: this will rename all the files in your current directory, so be careful
@jescalan
jescalan / example.less
Created May 9, 2012 15:25
less example
@blue: #30B5CE
.transition(@params: all .25s ease) {
-webkit-transition: @params
-moz-transition: @params
transition: @params
}
.box {
background: darken(@blue, 10%)
@jescalan
jescalan / example.sass
Created May 9, 2012 15:41
sass example
=button($bgcolor)
$dark-text: if( lightness($bgcolor) < 60%, true, false )
$text-color: if( $dark-text, $white, #494949 )
background: $bgcolor
color: $text-color
.box
+button(#CE5543)