Skip to content

Instantly share code, notes, and snippets.

View seanwash's full-sized avatar
🏠
Working from home

Sean Washington seanwash

🏠
Working from home
View GitHub Profile
@seanwash
seanwash / README.md
Last active August 29, 2015 14:15
Wordpress Deploy via Grunt
  1. Setup local wordpress install & local wordpress database
  2. Create production database from mysql wizard (make new user password and db)
  3. Setup grunt files from the wordpress root in the console (rememeber you can drag and drop a folder onto the console and hit enter):
  • $ npm init & Fill in relevant details (you can just hit enter a few times)
  • $ npm install grunt --save-dev - install grunt into node_modules folder
  • $ npm install grunt-wordpress-deploy --save-dev - install grunt wordpress deploy into node_modules folder
  • Create gruntfile.js in root & copy and paste below gruntfile.js into yours.
  • Fill in the local and production information
    • Remember that the two path: lines need to have a trailing slash / (lines 37 & 46)
  1. grunt push_files --target=production
@seanwash
seanwash / lazy.coffee
Last active August 29, 2015 14:21
First pass at a lazy loader for images
class LazyLoad
constructor: (lazySelector, container) ->
return console.error 'LazyLoad: LazySelector is not defined' unless lazySelector?.length
return console.error 'LazyLoad: Container is not defined' unless container?.length
@container = $(container)
@lazySelector = lazySelector
@lazyItems = @container.find(lazySelector)
@wh = $(window).height()
@itemOffsets = []
<?php
class Hooks_kollide_password_protect extends Hooks
{
public $meta = array(
'name' => 'Kollide - Password Protect',
'version' => '1.0.0',
'author' => 'Sean Washington',
'author_url' => 'http://octopuscreative.com'
);
@seanwash
seanwash / install-comodo-ssl-cert-for-nginx.rst
Last active August 29, 2015 14:27 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@seanwash
seanwash / px-rem-cheat-sheet.css
Created September 25, 2015 22:20 — forked from glueckpress/px-rem-cheat-sheet.css
Cheat sheet for rem-calculations based upon 14px and 16px.
/*! = $rembase: 14px
--------------------------------------------------------------
* hmtl { font-size: 87.5%; }
* body { font-size: 14px; font-size: 1rem; line-height: 1; }
* 4px 0.28571429rem
* 8px 0.571428571rem
* 12px 0.857142857rem
* 13px 0.928571429rem
* 14px 1rem
* 16px 1.142857143rem
@seanwash
seanwash / news-viewer.coffee
Created October 23, 2015 15:29
News Viewer Component
NewsViewer = Vue.extend
props: ['news', 'ready', 'activeIndex']
data: ->
news: null
activeIndex: 1
ready: false
direction: 'down'
template: """
@seanwash
seanwash / insights-viewer.coffee
Created October 23, 2015 15:30
Insights Viewer Component
InsightsViewer = Vue.extend
props: ['insights', 'ready', 'activeIndex']
data: ->
insights: null
activeIndex: 0
ready: false
userDidInteract: false
template: """
@seanwash
seanwash / add-to-cart.coffee
Last active October 27, 2015 17:01
Vue.js Component <-> Store messaging
AddToCartButton = Vue.extend
data: ->
loading: false
success: false
error: false
errorMessage: null
template: """
<div v-el:buttoncontainer class="add-to-cart-container" :class="{'-loading': loading}" transition="all">
<loading-indicator v-show="loading" transition="fade"></loading-indicator>

Deploy Rails 4 app with Dokku on DigitalOcean

Install dokku

First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel

Then ssh with root account, run this in termianl:

$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash