Skip to content

Instantly share code, notes, and snippets.

View bigsweater's full-sized avatar

Vincent Maglione bigsweater

View GitHub Profile

Contract Killer 3

Revised date: 08/14/2013

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@bigsweater
bigsweater / post_receive
Created August 22, 2013 18:51
This is a post-receive file for use with your own private git server. Say you wanna deploy using git, but you have multiple branches that you want to deploy to multiple places. For instance, you have a 'dev' branch that should only deploy to dev.yoursite.com, and a 'master' branch that will only deploy to yoursite.com. Once you git init into the…
#!/bin/bash
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
GIT_WORK_TREE=/path/to/your/live/deployment/ git checkout -f $branch
echo 'Changes pushed live.'
fi
@bigsweater
bigsweater / mderb.rb
Created September 21, 2013 06:41
A Middleman helper that creates a `<% markdown do %>` method to parse markdown text inside ERb templates, so you can use markdown for content and ERb for layout in the same file. (Similar to the :markdown HAML method.)
module MD
def renderer
Redcarpet::Render::HTML.new(
:no_intra_emphasis => true,
:tables => true,
:fenced_code_blocks => true,
:disable_indented_code_blocks => true,
:autolink => true,
:filter_html => false,
:with_toc_data => true
@bigsweater
bigsweater / gist:6677128
Last active December 23, 2015 18:39
syntaxerror from my markdown helper
SyntaxError: d:/work/Dropbox/Work Sync/bsd/site/mm/source/about.html.erb:2: syntax error, unexpected ')'
; @_out_buf.concat(( md do ).to_s)
^
d:/work/Dropbox/Work Sync/bsd/site/mm/source/about.html.erb:66: syntax error, unexpected keyword_ensure, e
xpecting ')'
d:/work/Dropbox/Work Sync/bsd/site/mm/source/about.html.erb:68: syntax error, unexpected keyword_end, expe
cting ')'
c:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-1.3.7/lib/tilt/template.rb:227:in `class_eval'
c:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-1.3.7/lib/tilt/template.rb:227:in `compile_template_metho
d'
@bigsweater
bigsweater / leadtracking.js
Last active December 28, 2015 22:39
Lead tracking with jquery.
/* This code relies on two small jQuery plugins:
*
* jQuery Cookie Plugin
* https://github.com/carhartl/jquery-cookie
*
* and
*
* jQuery replaceText - v1.1 - 11/21/2009
* http://benalman.com/projects/jquery-replacetext-plugin/
*
@bigsweater
bigsweater / individual-document.php
Created December 18, 2013 22:17
A WordPress widget that generates a JPG of the first page of the first PDF it finds attached to the page it's assigned to.
<?php
function load_pmg_single_doc() {
register_widget('PMG_Single_Doc');
}
add_action('widgets_init', 'load_pmg_single_doc');
class PMG_Single_Doc extends WP_Widget {
function PMG_Single_Doc() {
@bigsweater
bigsweater / config.rb
Created December 31, 2013 20:31
My own config.rb recipe for web dev projects
require 'susy'
require 'animation'
#================================================#
#Section: Default Properties #
#================================================#
project_type = :stand_alone
relative_assets = true
disable_warnings = false
preferred_syntax = :scss
@bigsweater
bigsweater / main.scss
Last active January 1, 2016 21:09
A boilerplate main.scss for organized imports and atomic css
// Vendor dependencies.
@import "compass";
@import "susy";
@import "animation";
// Author dependencies.
@import "mixins";
@import "variables";
@import "animations"; // Animation mixins
@bigsweater
bigsweater / Capfile
Created March 2, 2014 14:11
Capfile for deploying Bedrock on MediaTemple's GridServer
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Load tasks from gems
require 'capistrano/composer'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
<?php
/**
* Plugin Name: Grunt Sitemap Generator
* Plugin URI: http://www.github.com/lgladdy
* Description: Generate a JSON list of every page on a site so it can be used with grunt and uncss. Create a folder in /wp-content called mu-plugins, and drop this code into that folder, as grunt-sitemap.php
* Author: Liam Gladdy
* Author URI: http://gladdy.co.uk
* Version: 1.0
*/