Skip to content

Instantly share code, notes, and snippets.

@jvlahos
jvlahos / desktop.profile
Created September 22, 2013 17:50
Quickly show/hide your desktop icons. Good for presentations or taking clean desktop screenshots / photos. Add it to the bottom of your .bash_profile file. Then run 'hideDesktop' or 'showDesktop' in your terminal.
alias hideDesktop='defaults write com.apple.finder CreateDesktop -bool false; killall Finder'
alias showDesktop='defaults write com.apple.finder CreateDesktop -bool true; killall Finder'
@jvlahos
jvlahos / isElement.scss
Last active December 21, 2015 20:09
isElement SASS function
@function isElement($name){
//Used MDN for reference list: https://developer.mozilla.org/en-US/docs/Web/HTML/Element
$htmlElements: a, abbr, acronym, address, applet, area, article, aside, audio, b, base, basefont, bdi, bdo, bgsound, big, blink, blockquote, body, br, button, canvas, caption, center, cite, code, col, colgroup, data, datalist, dd, decorator, del, details, dfn, dir, div, dl, dt, em, embed, fieldset, figcaption, figure, font, footer, form, frame, frameset, h1, h2, h3, h4, h5, h6, head, header, hgroup, hr, html, i, iframe, img, input, ins, isindex, kbd, keygen, label, legend, li, link, listing, main, map, mark, marquee, menu, menuitem, meta, meter, nav, nobr, noframes, noscript, object, ol, optgroup, option, output, p, param, plaintext, pre, progress, q, rp, rt, ruby, s, samp, script, section, select, small, source, spacer, span, strike, strong, style, sub, summary, sup, table;
@if index($htmlElements, $name) == false {
@return false;
} @else {
@return true;
}
}
@jvlahos
jvlahos / sublime-settings.js
Last active December 19, 2015 12:59
Some Sublime Text settings worth taking a look at.
{
//Note: this isn't a Javascript file. It's a .sublime-settings file
//Add whatever you want to user settings, Sublime Text 2 > Preferences > Settings - User
//All settings (of which these are copied from) are at Sublime Text 2 > Preferences > Settings - Default
// I've read some recent best practice docs that 2-space indentation is better than tabs
// This setting translates tab presses to spaces for you
// 2 spaces doesn't feel like much though... not sure about this
@jvlahos
jvlahos / buttons.scss
Last active December 19, 2015 10:59
Bourbon.io mixin research
//Button mixin
//This is more like a tool for creating buttons
//Instead of just a framework/nomenclature for defining them
@mixin button ($style: simple, $base-color: #4294f0) {
@if type-of($style) == color {
$base-color: $style;
$style: simple;
}
@jvlahos
jvlahos / cols.scss
Last active December 19, 2015 01:39
cols(x) mixin adapted off of Upstatement's ui-block mixin.
@mixin cols($col-num: 2, $width-1: 0, $width-2: 0, $width-3: 0, $width-4: 0, $width-last: 0, $margin-r:5% ) {
@include pie-clearfix;
$var-list: $col-num, $width-1, $width-2, $width-3, $width-4, $width-last, $margin-r;
//Discovers margin option
@for $num from 1 through length($var-list) {
$value: nth($var-list, $num);
@if $num == ($col-num + 2){
@if $num < length($var-list) {
@jvlahos
jvlahos / examples.scss
Last active December 19, 2015 01:38
ui-grid(x) with margin in second position
.examples {
@include ui-grid;
@include ui-grid(2);
@include ui-grid(flip);
@include ui-grid(2, 2.5%, 60%, 40%);
@include ui-grid(2, 2.5%, 60%, 40%, flip);
@include ui-grid(3);
@jvlahos
jvlahos / games.json
Last active December 18, 2015 14:58
Blades Data Structure
{
"games": [
{
"game_id": 499,
"p1_id": 0,
"p2_id": 1,
"game_num": 500,
"win_p_id": 1,
"p1_per_1": 2,
@jvlahos
jvlahos / context.scss
Last active December 17, 2015 12:18
Simple but versatile context mixin. Treat contextual styles holistically.
// Context mixin
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
// FOR: Creating contextual styles
// Responsive breakpoints, @media contexts, and ascendant classes (like from Modernizr)
// WHY: Context is key and shouldn't be afterthought, code organization
// USE: context(300px){} context(print){}
// context(tablet-landscape){} context(touch){} context(ie7){}
@mixin context($values...) {
@each $value in $values {
$type: type_of($value);