Skip to content

Instantly share code, notes, and snippets.

View SimplGy's full-sized avatar

Eric Miller SimplGy

View GitHub Profile
@SimplGy
SimplGy / brandColors.sass
Created May 16, 2013 23:07
Brand Colors in a sass file for easy use in stylesheets. Feel free to add to this list :)
// brandcolors.net
$colorFacebook: #3b5998
$colorFitbit: #48c1c4
$colorLinkedIn: #0e76a8
$colorGoogle: #db4a39
$colorTwitter: #00acee
@SimplGy
SimplGy / bootstrapButtonOverrider.sass
Created May 16, 2013 23:17
Factory for creating bootstrap button overrides using sass. Used for, say, changing the color of the '.btn-primary' bootstrap button.
// This is a bootstrap button factory. Give it a class name and a color and it will build you a shiney bootstrap button override. Wowz.
// usage: +magicalButton('btn-green', green)
@mixin magicalButton($btnClassName: 'defaultPink', $color: #f66, $shading: 15, $highlighting: 10)
#{$btnClassName}
@include linear-gradient( $color, $color - $shading )
#{$btnClassName}:hover, #{$btnClassName}:focus
@include linear-gradient( $color + $highlighting, $color - $shading )
#{$btnClassName}:active, #{$color}.active
@include linear-gradient( $color + $highlighting*2, $color - $shading )
#{$btnClassName}.disabled, #{$btnClassName}[disabled]
@SimplGy
SimplGy / rockerButton.sass
Last active December 17, 2015 11:29
SASS styles for an image free rocker switch button for yes/no or similar 2 option choices. It's tricky in part because it's the `.active` state that has little styling, but the inactive state has transforms and other wonkiness. Output looks like this: http://i.imgur.com/twwQM3e.png
// Result: http://i.imgur.com/twwQM3e.png
@import '../bower_components/bourbon/app/assets/stylesheets/_bourbon.scss'
$colorBackbground: whitesmoke
$colorForeground: #333
$colorGood: springgreen
$radiusSmall: 4px
$spaceTiny: 3px
$spaceLil: 10px
@SimplGy
SimplGy / animationPlay
Last active December 18, 2015 08:00
SASS Animation Play
$colorGood: lawngreen
.circle
background: $colorGood
.circle.yay
+animation( blammo .5s )
+keyframes(blammo)
@SimplGy
SimplGy / apple-app-site-association
Last active December 20, 2015 00:58
Waitress app site assoc file
{
"applinks": {
"apps": [],
"details": [
{
"appID": "68Q8TRPLTN.com.waitress.ios",
"paths": [ "/place/*" ]
}
]
}
@SimplGy
SimplGy / screenSizeHelpers.sass
Last active December 20, 2015 21:28
Allows you to use simple block statements to conditionally target +phone, +desktop, and +tablet
$sizePhone: 603px
$sizeTablet: 1024px
@mixin phone
@media (max-width: $sizePhone)
@content
@mixin tablet
@media (min-width: $sizePhone+1) and (max-width: $sizeTablet)
@content
@SimplGy
SimplGy / 2xBackground
Created August 12, 2013 18:42
Creates 1x and 2x background images. The 200% means that the pixel offsets will work on both the small and large images. Make sure your sprites line up exactly, so that the 2x images are exactly twice as big, twice as low, and twice as left.
//Support 1 and 2x image sizes
@mixin 2xBackground($url)
background-image: url($url + ".png")
@media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3)
background-image: url($url + "@2x.png")
background-size: 200%
@SimplGy
SimplGy / algorithm test
Created August 30, 2013 18:11
Favorite unit test yet :) Uses a loop over a hash to test expectations
define [
'./circles'
],
(
Circles
) ->
_data = [
{ size: 2 }
{ size: 2 }
@SimplGy
SimplGy / rotationalCipher.rb
Created October 10, 2013 17:35
Ruby Implementation of a Rotational Cipher. Wrote in https://coderpad.io/966172
$ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
$alphabet = 'abcdefghijklmnopqurstvwxyz'
# Get an index of an alphabetic letter based on the index and offset
def calculateOffset(index, offset)
index += offset
index -= 26 while index >= 26 # keep subtracting until we get to the right range
index
end
@SimplGy
SimplGy / app.analytics.coffee
Last active January 4, 2016 11:34
Abstraction for an SPA's Analytics Library
define(
[]
() ->
_analyticsSites =
DEMO: 1
LOCALHOST: 2
_libUrl = (server) ->
'js!' + server + '/js/piwik.js'