Skip to content

Instantly share code, notes, and snippets.

Avatar

Eric Rasch ericrasch

View GitHub Profile
@ericrasch
ericrasch / 0_reuse_code.js
Created Aug 6, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ericrasch
ericrasch / gulpfile.js
Last active Aug 29, 2015
gulpfile for chugging gulp
View gulpfile.js
(function () {
'use strict';
var gulp = require('gulp');
var glob = require('glob');
var del = require('del');
var $ = require('gulp-load-plugins')();
var pkg = require('./package.json');
@ericrasch
ericrasch / reduce-repo-bloat.md
Last active Aug 29, 2015
Reduce Git/GitHub repo bloat size...
View reduce-repo-bloat.md

The following is what worked for me the best and easiest when trying to reduce the size of a GitHub repo. Download bfg.jar from this site: http://rtyley.github.io/bfg-repo-cleaner/ (discovered here: http://stackoverflow.com/a/15771042) Rename bfg.#####.jar to bfg.jar and put it in your root /github repo folder. Run the following commands:

git clone --mirror git@github.com:CMN/YourRepoName.com.git
ditto YourRepoName.com.git YourRepoName.com.backup.git
java -jar bfg.jar --strip-biggest-blobs 500 YourRepoName.com.git
cd YourRepoName.com.git
git reflog expire --expire=now --all
View _ Setup OSX 10.9 with a Clean Install.md

Setup OSX 10.9 with a Clean Install

After two years of tinkering my machine is a bit all over. With Mavericks I wanted to start fresh

1. Run Software Update

Make sure everything is up to date.

Software Update

@ericrasch
ericrasch / Gemfile
Created Feb 2, 2015
Generic Gemfile to add in a web project root.
View Gemfile
source 'https://rubygems.org'
gem 'capistrano', '~> 2.15'
gem 'capistrano-ext', '~> 1.2.1'
gem 'colored', '~> 1.2'
@ericrasch
ericrasch / gulp errors fixed.md
Last active Aug 29, 2015
NPM + Gulp.js errors (npm ERR + throw err + libsass) have been resolved...
View gulp errors fixed.md

When running npm update I was getting this error: npm ERR! cb() never called!

This answer on StackOverflow helped solve that issue:

So here's the fix for that. These steps are from David Walsh's blog

  1. Clear your npm cache: sudo npm cache clean -f
  2. Install the latest version of the Node helper: npm install -g n > 3. Tell the helper (n) to install the latest stable version of Node: sudo n stable
View content-kitchen-sink.html
<h1>
This is the primary heading and there should only be one of these per page
</h1>
<p>
A small paragraph to <em>emphasis</em> and show <strong>important</strong> bits.
</p>
<ul>
<li>This is a list item
</li>
<li>So is this - there could be more
@ericrasch
ericrasch / dabblet.css
Created Mar 13, 2012
HTML Kitchen Sink (taken from BlueTrip CSS Framework) includes the major (and minor) HTML tags you might use on any given site. Now available on http://dabblet.com/gist/2031276
View dabblet.css
/**
* HTML Kitchen Sink
*/
background: #fff;
font: normal normal 14px/1.4 Arial, "Helvetica Neue", Helvetica, sans-serif;
/* background: linear-gradient(45deg, #f06, yellow); */
min-height:100%;
@ericrasch
ericrasch / include-tweets.php
Created Mar 15, 2012
How to display your latest tweets in your WordPress site without a plugin
View include-tweets.php
<?php
// How to display your latest tweets in your WordPress site without a plugin
// Source: http://dinolatoga.com/2010/07/31/how-to-display-your-latest-tweets-in-your-wordpress-blog-without-a-plugin/
include_once(ABSPATH . WPINC . '/feed.php');
//configuration
$username = "EricRasch"; // Just insert the username of the Twitter account you want to display
$feed = "http://twitter.com/statuses/user_timeline/$username.rss"; // Changed the code from dinolatoga.com to actually use the username variable
$num = 2; // Set the number of Tweets you want to display
@ericrasch
ericrasch / dabblet.css
Created Jun 12, 2012
Ordered List Item Style Prefix
View dabblet.css
/**
* Ordered List Item Style Prefix
* prefix ordered list item numbers with a static string using CSS
* Dabblet (by @EricRasch): http://dabblet.com/gist/2919680
* jsFiddle (by @EricRasch): http://jsfiddle.net/NUJJk/
* SCSS Mixin (by @JimmyNotJim): http://jsfiddle.net/KY9ua/
* forked from: http://jsfiddle.net/BoltClock/9VdB3/
* StackOverflow Q&A: http://stackoverflow.com/a/5568259/1428800
*/
body {