Skip to content

Instantly share code, notes, and snippets.

@jasonmit
jasonmit / gist:2dd4aacb217a0b6b6098
Last active August 29, 2015 14:14
ember jsbin bases
@nikcorg
nikcorg / gist:1875753
Created February 21, 2012 10:48
Solve all your commit message problems with one small alias
alias commit='git commit -a -m \"$(curl -s http://whatthecommit.com|xpath "//p[1]/text()" 2>/dev/null)\"'
@kaplas
kaplas / _rem.scss
Last active December 17, 2015 06:18
A quick SASS helper function and mixin to calculate rem values and px fallbacks for it
@function strip-units($number) {
@return $number / ($number * 0 + 1);
}
@function rem($x, $fallback:false){
@if type-of($x) != "number" or $x == 0 {
@return $x;
} @else {
@Darep
Darep / rollbar.js
Last active December 21, 2015 22:29
Use Rollbar (https://rollbar.com/) with Browserify
// Download rollbar.js and rollbar.min.js from:
// http://d37gvrvc0wt4s1.cloudfront.net/js/1/rollbar.js
// http://d37gvrvc0wt4s1.cloudfront.net/js/1/rollbar.min.js
//
// Place them into vendor/ and this code into lib/rollbar.js, or something
(function(w, d) {
w._rollbarParams = {
"server.environment": "production",
"notifier.snippet_version": "2"
@arielsalminen
arielsalminen / 2col_masonry_layout.html
Last active October 15, 2016 21:22
Easily turn simple 1-column layout into a fluid 2-column masonry layout without JS plugins. Works even in IE6! Check the live example here: http://viljamis.com/columns/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>2-column fluid masonry layout without JS plugins</title>
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<style>
body {
text-align: center;
padding: 3% 8%;
@flarik
flarik / dot.powrc.sh
Created June 12, 2013 10:25
Pow's .porwrc config file for use with RVM's config files .rvmrc or .ruby-version (+ optional .ruby-gemset)
if [ -f "${rvm_path}/scripts/rvm" ]; then
source "${rvm_path}/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
elif [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
rvm use `cat .ruby-version`@`cat .ruby-gemset`
elif [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
@soffes
soffes / Podfile
Created May 13, 2013 15:46
Seesaw Podfile
platform :ios, '5.0'
# Awesome networking
pod 'AFNetworking'
# Backported UICollectionView
pod 'PSTCollectionView'
# Rich text
pod 'TTTAttributedLabel'
@jevakallio
jevakallio / reactiveconf-slam-poetry.md
Last active July 7, 2021 19:57
#ReactiveConf 2017 Lightning Talk Submission: JavaScript Slam Poetry

TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please ⭐ star this gist. If you're on mobile, you'll need to request desktop site.

JavaScript Slam Poetry

Javascript! Slam! Poetry!

mymodule {
@at-root {
.#{&}-header { ... }
.#{&}-footer { ... }
.#{&}-body {
a { ... }
span { ... }
p { ... }
}
}
@eirikbacker
eirikbacker / addEventListener-polyfill.js
Created June 3, 2012 19:30
addEventListener polyfill for IE6+
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
return (self = this).attachEvent('on' + on, function(e){
var e = e || win.event;
e.preventDefault = e.preventDefault || function(){e.returnValue = false}
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}