Skip to content

Instantly share code, notes, and snippets.

View jemgold's full-sized avatar
👽
vibing

Jem jemgold

👽
vibing
View GitHub Profile
// http://csswizardry.com/2012/06/single-direction-margin-declarations/
=font-size($sizeValue: 1)
font-size: ($sizeValue * 16) + px
font-size: $sizeValue + rem
=margin-top-rem($margin: 1.6)
margin-top: ($margin * 16) + px
margin-top: $margin + rem
=margin-right-rem($margin: 1.6)
// Love rems
=font-size($sizeValue: 1)
font-size: ($sizeValue * 16) + px
font-size: $sizeValue + rem
// http://csswizardry.com/2012/06/single-direction-margin-declarations/
// Could probably rewrite this into one mixin
=margin-right-rem($margin: 1.6)
margin-right: ($margin * 16) + px
margin-right: $margin + rem
@jemgold
jemgold / appdelegate.rb
Created October 31, 2012 16:27
Speech Synthesis in MacRuby
framework 'AppKit'
module AppDelegate
extend self
def applicationDidFinishLaunching(notification)
voice_type = "com.apple.speech.synthesis.voice.GoodNews"
@voice = NSSpeechSynthesizer.alloc.initWithVoice(voice_type)
end
@jemgold
jemgold / eden.scss
Created November 7, 2012 16:20 — forked from daneden/gist:4032573
Sass media queries and @extend
// Fairly safe way to visually hide content, but make it accessible to screen readers
.visually-hidden {
position: absolute;
left: -9999px;
height: 1px;
}
.mobile-offscreen {
@media screen and (max-width: 700px) {
@extend .visually-hidden;
//
// JGHypnosisView.m
// Hypnosister
//
// Created by Jon Gold on 25/11/2012.
// Copyright (c) 2012 Jon Gold. All rights reserved.
//
#import "JGHypnosisView.h"
#import <CoreMotion/CoreMotion.h>
@jemgold
jemgold / gist:4224353
Created December 6, 2012 13:10
Aliases
# Todo
alias todo='$EDITOR ~/.todo'
# Unix
alias tlf="tail -f"
alias ln='ln -v'
alias mkdir='mkdir -p'
alias ...='../..'
alias l='ls'
alias ll='ls -al'
// =funcs
// == clear (overrides clear to give clear fix)
clear(arg)
if arg is "fix"
&:before
&:after
content: " "
display: table
&:after
clear: both
function handleScroll() {
$(window).scroll(_.throttle(
function(){
radFunction();
// needed to wrap this function call in an anonymous function
// to get things working. *shrug*
}, 300)
);
}
@jemgold
jemgold / regex.js
Last active December 11, 2015 04:58
Every so often I find myself running a server in development mode and needed to copy some compiled Stylus to work with. PITA because it's littered with (usually very helpful) Stylus debug notes. Here's a quick & dirty regex to find them in Sublime for deletion.
^(\/\* line\s(\d+)|@media -stylus-debug)(.+)$\n
# config/initializers/
Mongoid::Document.send(:include, ActiveModel::SerializerSupport)
Mongoid::Criteria.delegate(:active_model_serializer, to: :to_a)