Skip to content

Instantly share code, notes, and snippets.

View shrunyan's full-sized avatar

Stuart Runyan shrunyan

View GitHub Profile
@shrunyan
shrunyan / local-website-dev-steps.md
Last active August 29, 2015 14:21
Steps to create a local development website

How to Setup a Local Development Website

Instructions from a Macbook pro running OSX 10.10

Create a Project Directory

Either checkout an existing repostiory or create a new one.

Existing:

@shrunyan
shrunyan / zesty-form.html
Last active August 29, 2015 14:22
Example form on the Zesty.io platform
<form action="/thank-you/" method="POST" enctype="multipart/form-data">
<!-- These values control how Zesty understands the form. -->
<input name="zlf" value="{{ page.title }} Form Request" type="hidden">
<input name="zcf" value="1" type="hidden">
<label for="first_name">First Name*</label>
<input name="first_name" id="first_name" maxlength="50" type="text" required autofocus />
<label for="last_name">Last Name*</label>
@shrunyan
shrunyan / jquery-form-post-capture.js
Last active August 29, 2015 14:22
jQuery script which will post a form to another url before posting to the default action attribute. Being used to capture a form lead submission to both the first party platform as well as Salesforce.
<script type="text/javascript">
// Using jQuery Library
$('#salesforce-form').one('submit', function(e) {
e.preventDefault();
var $form = $(this);
$.ajax({
url: '{{ page.getUrl() }}',
type: 'POST',
data: $form.serialize(),
success: function cb() {
@shrunyan
shrunyan / zip-code-search.js
Last active August 29, 2015 14:22
Parsley code to iterate on a dataset and filter by GET parameters being posted to the file.
// zip-search-form.tpl
<input id="search" />
<ul id="results"></ul>
// zip-search-results.tpl
// template which generates results being returned to AJAX request
// % is the wildcard character in Parsley
{{each events as event WHERE event.zip_code LIKE '{get_var.term}%'}}
<li>
<h2>{{event.title}}</h2>
@shrunyan
shrunyan / README.md
Last active August 29, 2015 14:23 — forked from jonathantneal/README.md

Local SSL websites on Mac OSX

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on Mac OSX Yosemite.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward edit to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@shrunyan
shrunyan / .vimrc
Last active August 29, 2015 14:24
My .vimrc file
" Make Vim more useful
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
@shrunyan
shrunyan / gulpfile.js
Last active August 29, 2015 14:25 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@shrunyan
shrunyan / index.html
Last active August 29, 2015 14:26 — forked from benjchristensen/index.html
Simple Sparkline using SVG Path and d3.js
<html>
<head>
<title>Simple Sparkline using SVG Path and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@shrunyan
shrunyan / block-filter.css
Last active August 29, 2015 14:26 — forked from aarongustafson/block-filter.css
@supports IE TestDrive Code Samples
b {
background-color: red;
}
@media only screen {
b {
background-color: green;
}
b[class] {
background: linear-gradient( 0deg, rgb(65, 150, 44), rgb(26, 219, 73) );
@shrunyan
shrunyan / keybase.md
Last active September 16, 2015 00:05

Keybase proof

I hereby claim:

  • I am shrunyan on github.
  • I am stuartrunyan (https://keybase.io/stuartrunyan) on keybase.
  • I have a public key whose fingerprint is 8D72 FEEF 37E7 4BAE 5966 FB39 6E65 6E79 DB7F A5BF

To claim this, I am signing this object: