Skip to content

Instantly share code, notes, and snippets.

View JustJenFelice's full-sized avatar

Jennifer Culp JustJenFelice

View GitHub Profile
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
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.

@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@TomByrne
TomByrne / MultiExporter.jsx
Last active May 5, 2024 21:54
An Illustrator script for exporting layers and/or artboards into separate files (PNG8 / PNG24 / EPS / PDF / SVG / JPG / FXG).See http://www.tbyrne.org/export-illustrator-layers-to-svg-files
// MultiExporter.jsx
// Version 0.1
// Version 0.2 Adds PNG and EPS exports
// Version 0.3 Adds support for exporting at different resolutions
// Version 0.4 Adds support for SVG, changed EPS behaviour to minimise output filesize
// Version 0.5 Fixed cropping issues
// Version 0.6 Added inner padding mode to prevent circular bounds clipping
//
// Copyright 2013 Tom Byrne
// Comments or suggestions to tom@tbyrne.org
@FokkeZB
FokkeZB / README.md
Created September 20, 2013 09:38
URL schemes for iOS and Android (2/2)
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
@LeaVerou
LeaVerou / dabblet.css
Created May 28, 2013 20:22
Animated CSSConf gradient
/* Animated CSSConf gradient */
@keyframes move {
to { background-position: 0 1950px, 50px 2000px; }
}
body {
min-height: 100%;
margin: 50px auto;
background-color: #96cd23;
@olexpono
olexpono / Custom.css
Last active February 14, 2023 15:44
Crate -- a Dark gray/orange Theme for Chrome DevTools
/**********************************************/
/*
/*
/* Crate -- Theme for Chrome DevTools
/* Last Update :: September 2013
/*
/* based on:
/* mnml by Michael P. Pfeiffer
/* Based on a Gist by Ben Truyman. Further attr:
/* https://gist.github.com/3040634
@cowboy
cowboy / bocoup-training-more-efficient-event-handlers.js
Created February 12, 2013 21:38
Bocoup training: More Efficient jQuery Event Handlers
// Straightforward + simple.
$("button").on("click", function(event) {
event.preventDefault();
var button = $(this);
var numberElem = button.find(".number");
var number = Number(numberElem.text()) - 1;
numberElem.text(number);
if (number === 0) {
button.prop("disabled", true);
button.off("click");
@dvessel
dvessel / r-em-sizing.scss
Last active October 30, 2018 09:59
font-size in rem and a tool for absolute to em conversion. http://css-tricks.com/snippets/css/less-mixin-for-rem-font-sizing/
// Inspired by this post from CSS-Tricks.
// http://css-tricks.com/snippets/css/less-mixin-for-rem-font-sizing/
//
// Plays nice with compass/typography/vertical_rhythm
// http://compass-style.org/reference/compass/typography/vertical_rhythm/
//
// Calculates font size in `rem` (root em).
//
// Relative values depends on $base-font-size. Pixle value for font-size depends
// on $legacy-support-for-ie6 or $legacy-support-for-ie7 or $legacy-support-for-ie8
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"