Skip to content

Instantly share code, notes, and snippets.

@mhayes
mhayes / SassMeister-input.scss
Created Feb 5, 2014
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// libsass (v0.7.0)
// ----
// works in libsass, not in ruby sass
$text-direction: ltr;
$text-direction: ltr !default;
@mhayes
mhayes / setup.sh
Created Apr 29, 2014
Setup SassC + LibSass on MacOSX (tested on 10.9.2 only)
View setup.sh
#!/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 Aug 29, 2015
Setup Foundation
View setup.sh
#! /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 Aug 29, 2015
Need quick way to rename files according to a sequence?
View README.md

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 Jun 15, 2010
A Mongoid implementation of meeting minutes
View action_item.rb
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 Jul 1, 2010
Use to collect sort position from jqueryUI
View sortOrder.js
$(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 Jul 16, 2010
ColdFusion migrations idea
View migration.cfm
<!---
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>
View col.cfc
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 Aug 10, 2010
Rails3 application template
View base_template.rb
#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
You can’t perform that action at this time.