Skip to content

Instantly share code, notes, and snippets.

View nathanlong's full-sized avatar

Nathan Long nathanlong

View GitHub Profile
@nathanlong
nathanlong / gulpfile.js
Last active June 15, 2017 06:10
Gulp Rsync
var gulp = require('gulp');
var rsync = require('gulp-rsync');
gulp.task('deploy', function(){
// Dirs and Files to sync
rsyncPaths = ['rsynctest01' ];
// Default options for rsync
rsyncConf = {
verbose: true,
@nathanlong
nathanlong / package.json
Created October 26, 2015 14:39
Node 0.10 and 0.12 package.json for Pace Projects
{
"devDependencies": {
"gulp": "^3.9.0",
"gulp-autoprefixer": "^2.3.1",
"gulp-concat": "^2.5.2",
"gulp-notify": "^2.2.0",
"gulp-sass": "^2.0.1",
"gulp-uglify": "^1.2.0",
"gulp-changed": "^1.2.1"
}
@nathanlong
nathanlong / gulpfile.js
Created October 26, 2015 14:35
pi-core gulpfile.js
var gulp = require('gulp');
var concat = require('gulp-concat');
var libsass = require('gulp-sass');
var autoprefix = require('gulp-autoprefixer');
var uglify = require('gulp-uglify');
var notify = require('gulp-notify');
var changed = require('gulp-changed');
// Asset Handling - SCSS and JS
// ---------------------------------------------------------------------------
@nathanlong
nathanlong / gist:bc1d4923982ad45e9379
Last active May 31, 2018 04:56
Local Servers from the Command Line
# Drop these functions into your ~/.bashrc or ~/.bash_profile, wherever you keep your bashy goodness.
# Usage: cd to directory you want to serve up, fire one of these commands, navigate to http://0.0.0.0:{port number here}
# Start an HTTP server from a directory, optionally specifying the port
function serverpy() {
local port="${1:-8000}"
open "http://localhost:${port}/"
# Set the default Content-Type to `text/plain` instead of `application/octet-stream`
# And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files)
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port"
@nathanlong
nathanlong / gist:834de5ea103da60d13c2
Created December 11, 2014 17:04
jekyll next/prev navigation
<section class="post-nav container clearfix">
{% if page.previous.url %}
<a class="prev" href="{{page.previous.url}}">&larr; {{page.previous.title}}</a>
{% endif %}
{% if page.next.url %}
<a class="next" href="{{page.next.url}}">{{page.next.title}} &rarr;</a>
{% endif %}
</section>
@nathanlong
nathanlong / gist:6faa7115c93b5f29ca7d
Last active August 29, 2015 14:05
Contract Terms

Date: [insert date]

Between me, Nathan Long, and you, [Client]

I will do my best to fulfill your needs and meet your goals, but sometimes it’s best to have everything stated up front.

In short...

You ( [Client] ) are hiring me (Nathan Long) located at [address] to [description of work], (the project) for the estimated total price of [price] as we agreed upon in our previous correspondence. Before I begin working I require a [50%] retainer fee, which amounts to [retaineramount].

"-----------------------------------------------------------------------------
" GENERAL SETTINGS
"-----------------------------------------------------------------------------
set encoding=utf-8 "UTF8 All day, every day
set nocompatible "Use vim settins, not vi settings. Affects a lot.
call pathogen#infect() "Initialize Pathogen
call pathogen#helptags() "Update the help file tags for plugins
filetype on "Enable filetypes
filetype plugin on "Enable filetype plugins
@nathanlong
nathanlong / Grunt Lazy Load Tasks
Last active January 1, 2016 18:39
from https://github.com/gruntjs/grunt/issues/975#issuecomment-29058707 I've wanted this feature for a while too, especially as I'm using a plugin that depends on imagemin which can take up to 30 seconds to spin up. This slows everything down and is especially annoying as the task that relies on imagemin is barely used. I've recently found a way …
BEFORE
---
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.registerTask('images', ['copy:standardImages', 'responsive_images', 'imagemin']);
AFTER
---
grunt.registerTask('images', [], function () {