Skip to content

Instantly share code, notes, and snippets.

@edavis10
edavis10 / _config.yml
Created November 6, 2009 02:18
Pagination in Jekyll
# ....other stuff here
paginate: 10
#!/bin/bash
usage()
{
cat <<USAGE
./_script/generate post
USAGE
exit 42
}
#!/bin/sh
#
# This hook does two things:
#
# 1. update the "info" files that allow the list of references to be
# queries over dumb transports such as http
#
# 2. if this repository looks like it is a non-bare repository, and
# the checked-out branch is pushed to, then update the working copy.
# This makes "push" function somewhat similarly to darcs and bzr.
@stephanschubert
stephanschubert / cross-browser-background-rgba.scss
Created April 18, 2011 05:44
SCSS mixin for cross-browser background-color: rgba(...). You'll need the Ruby extension for convenient color conversion rgba->hex (IE uses ARGB)
@mixin background-rgba($r,$g,$b,$a) {
// To mimic this in Internet Explorer, you can use the proprietary filter
// property to create a gradient with the same start and end color, along
// with an alpha transparency value.
@if experimental-support-for-microsoft {
$color: ie_hex($r,$g,$b,$a);
$value: unquote("progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=##{$color},endColorstr=##{$color})");
background-color: transparent\9;
2012-04-27T21:10:44Z 530 TID-owb1ckq7w INFO: Booting sidekiq 1.1.4 with Redis at redis://localhost:6379/6
2012-04-27T21:10:44Z 530 TID-owb1ckq7w INFO: Running in ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]
2012-04-27T21:10:44Z 530 TID-owb1ckq7w DEBUG: {:queues=>["default"], :concurrency=>25, :require=>".", :environment=>"development", :timeout=>8, :enable_rails_extensions=>true}
2012-04-27T21:10:44Z 530 TID-owb099rks INFO: Starting processing, hit Ctrl-C to stop
2012-04-27T21:10:59Z 530 TID-owb14h9wk INFO: IntuitSyncRequest MSG-owb14ha9w start
/Users/codyc/.rvm/gems/ruby-1.9.3-p194@vino/gems/activerecord-3.2.2/lib/active_record/result.rb:30: [BUG] Segmentation fault
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]
-- Control frame information -----------------------------------------------
@andyhawthorne
andyhawthorne / unicorn.rb
Created September 4, 2012 22:29
unicorn
root = "/home/you/apps/appname/current"
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.log"
stdout_path "#{root}/log/unicorn.log"
listen "/tmp/unicorn.your_user_name.sock"
worker_processes 2
timeout 30
@andyhawthorne
andyhawthorne / unicorn_init.sh
Created September 4, 2012 22:35
start unicorn
#!/bin/sh
set -e
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/home/you/apps/app_name/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
CMD="cd $APP_ROOT; bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E production"
AS_USER=andy
set -u
@mkdynamic
mkdynamic / ajaxsubscribe.html
Last active December 7, 2017 08:18 — forked from jdennes/LICENSE
<!-- 1. Take your Campaign Monitor subscribe form as generated from within your account: -->
<form action="http://myaccount.createsend.com/t/r/s/aljhk/" method="post" id="subForm">
<div>
<label for="name">Name:</label><br /><input type="text" name="cm-name" id="name" /><br />
<label for="aljhk-aljhk">Email:</label><br /><input type="text" name="cm-aljhk-aljhk" id="aljhk-aljhk" /><br />
<input type="submit" value="Subscribe" />
</div>
</form>
@rickydazla
rickydazla / retina-logo.html
Last active March 10, 2016 02:04
Shopify Retina SVG logo switcheroo_modernizr
<a href="{{ shop.url }}">
<img
src="{{ 'logo.png' | asset_url }}"
alt="{{ shop.name }}"
data-retina-src="{{ 'logo.svg' | asset_url }}">
</a>
<script type="text/javascript">
Modernizr.addTest('retina', function () {
return (!!navigator.userAgent.match(/Macintosh|Mac|iPhone|iPad/i) && window.devicePixelRatio==2);
});
@jondcampbell
jondcampbell / template.php
Created October 20, 2014 17:46
Get product brand thumbnails in a random order. Replaces [product_brand_thumbnails]
<?php
// This code is basically taken out of the product_brand_thumbnails shortcode and then we add in some shuffling of the order
$brands = get_terms( 'product_brand', array( 'hide_empty' => 0, 'orderby' => 'name', 'exclude' => '', 'number' => 5, 'order' => 'ASC' ) );
if ($brands ):
$columns = 5;
// Randomly order the brands
shuffle($brands);
?>