Skip to content

Instantly share code, notes, and snippets.

View philipmadeley's full-sized avatar

Philip Madeley philipmadeley

View GitHub Profile
@JesseBilsten
JesseBilsten / Default.sketchpalette
Created November 17, 2015 22:44
A Default color palette for Sketch Color Palette Plugin
{"compatibleVersion":"1.0","pluginVersion":"1.1","colors":["#D40619","#F7A716","#F8E900","#8C5828","#77D406","#3D7600","#C100E2","#9400FE","#488EE3","#40E3C1","#B5EA83","#000000","#4A4A4A","#9B9B9B","#FFFFFF"]}
@philipmadeley
philipmadeley / ej_exercises.js
Last active September 15, 2015 09:22
EJ Exercises with explanations
/* 4.4 deep linking
*/
function deepEqual(a, b) {
if (a === b) return true;
if (a == null || typeof a != "object" ||
b == null || typeof b != "object")
return false;
@jayperryworks
jayperryworks / gulpfile.js.jekyll-uncompiled
Last active August 29, 2015 14:02
gulpfile for jekyll (github pages, uncompiled version)
'use strict';
// generated on 2014-05-21 using generator-gulp-webapp 0.1.0
var gulp = require('gulp');
// useful file paths
var path = {
app: 'app',
dist: 'dist',
bower: '_bower_components',
@import "modular-scale";
@import "functions";
$base-font-size: 16px;
$base-line-height: 24px;
$rhythm-unit: "rem";
// Setup vertical rhythm
@include establish-baseline;
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 8, 2025 15:03
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@jlong
jlong / SassMeister-input.scss
Created January 14, 2014 15:53
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
$sections: red, gold, orange, grey;
@each $i in $sections {
.section-#{$i} {
@yoshuawuyts
yoshuawuyts / Stylus REM mixin
Last active June 2, 2021 17:34
Stylus REM mixin (font-size, line-height).
//define default values (best to put this in the default.styl file)
base-font-size = 16
base-line-height = 24
//This is the useful part: it compares the given value to the base values and calculates the correct output
font-size($fontValue = base-font-size, $baseFontValue = base-font-size, $baseLineValue = base-line-height)
font-size $fontValue px
font-size ($fontValue / $baseFontValue) rem
line-height ($fontValue / $baseFontValue) * $baseLineValue
line-height ($baseLineValue/$baseFontValue) * ($fontValue / $baseFontValue) rem
@cimmanon
cimmanon / flexbox.scss
Last active January 14, 2025 18:21 — forked from anonymous/Flexbox mixins
This collection of Sass mixins to cover all 3 flexbox specifications that have been implemented. More information can be found here: https://gist.github.com/cimmanon/727c9d558b374d27c5b6
@import "compass/css3/shared";
// NOTE:
// All mixins for the 2009 spec have been written assuming they'll be fed property values that
// correspond to the standard spec. Some mixins can be fed values from the 2009 spec, but don't
// rely on it. The `legacy-order` mixin will increment the value fed to it because the 2009
// `box-ordinal-group` property begins indexing at 1, while the modern `order` property begins
// indexing at 0.
// if `true`, the 2009 properties will be emitted as part of the normal mixin call