Skip to content

Instantly share code, notes, and snippets.

@mhayes
mhayes / SassMeister-input.scss
Created February 5, 2014 19:57
Generated by SassMeister.com.
// ----
// libsass (v0.7.0)
// ----
// works in libsass, not in ruby sass
$text-direction: ltr;
$text-direction: ltr !default;
@mhayes
mhayes / setup.sh
Created April 29, 2014 22:51
Setup SassC + LibSass on MacOSX (tested on 10.9.2 only)
#!/bin/bash
# # Allow us to compile from source
# https://github.com/hcatlin/libsass/archive/master.zip
# https://github.com/hcatlin/sassc/archive/master.zip
TMPFILE="libsass"
PWD=`pwd`
wget "https://github.com/hcatlin/libsass/archive/master.zip" -O $TMPFILE
unzip -d $PWD $TMPFILE
@mhayes
mhayes / setup.sh
Last active August 29, 2015 14:06
Setup Foundation
#! /bin/sh
mkdir -p ~/Sites/zurb-foundation
cd ~/Sites/zurb-foundation
npm install bower grunt-cli -g
rc=$?
if [[ $rc != 0 ]] ; then
sudo npm install bower grunt-cli -g
fi
echo "[SUCCESS] Installed bower and grunt";
@mhayes
mhayes / README.md
Last active August 29, 2015 14:22
Need quick way to rename files according to a sequence?

quickstart

Let's assume you have OS X screenshots named like Screen Shot 2015-06-09 at 9.39.56 AM.png. You can use this script to rename them like so:

mark:screens mark$ ruby renamer.rb 
move ./Screen Shot 2015-06-09 at 9.39.56 AM.png to EXAMPLE_ONE_160x600_1.png
move ./Screen Shot 2015-06-09 at 9.39.57 AM.png to EXAMPLE_ONE_160x600_2.png
move ./Screen Shot 2015-06-09 at 9.39.58 AM.png to EXAMPLE_ONE_160x600_3.png
move ./Screen Shot 2015-06-09 at 9.40.00 AM.png to EXAMPLE_ONE_160x600_4.png
@mhayes
mhayes / action_item.rb
Created June 15, 2010 23:28
A Mongoid implementation of meeting minutes
class ActionItem
field :due_date, :type => Date
field :completed, :type => Boolean
field :description
has_one_related :person
embedded_in :meeting, :inverse_of => :action_items
@mhayes
mhayes / sortOrder.js
Created July 1, 2010 18:14
Use to collect sort position from jqueryUI
$(function() {
$(".multiselect").multiselect();
$('#sortFields').sortable({
update:function(event,ui) {
var arr = $('#sortFields').sortable('toArray');
var newVal = "";
for(i=1; i<arr.length; i++) { newVal += arr[i] + ","; }
$('#sortOrderIds').val(newVal);
}
});
@mhayes
mhayes / migration.cfm
Created July 16, 2010 17:28
ColdFusion migrations idea
<!---
Database Migration Script:
Instructions here
--->
<cfsavecontent variable="up">
<!--- The contents in this section will be used to apply your update --->
CREATE VIEW [ats].[VW_R_T1]
AS
SELECT TOP 3 * FROM ats.vw_r
</cfsavecontent>
component name="col" {
function init(
required string name,
required string displayName,
required string dataType="string",
required boolean canSort=false,
required boolean canDisplay=false
) {
variables.tbl = "";
variables.name = arguments.name;
@mhayes
mhayes / base_template.rb
Created August 10, 2010 04:59
Rails3 application template
#base_template.rb
#sets up basic rails3 application structure with jquery-ujs
#remove index page
run "rm public/index.html"
@jquery_link = "http://code.jquery.com/jquery-1.4.1.min.js"
@jquery_ujs_link = "http://github.com/rails/jquery-ujs/raw/master/src/rails.js"
#setup Gemfile