Skip to content

Instantly share code, notes, and snippets.

@dvessel
dvessel / ren.php
Created February 5, 2011 22:37
drupal_render + CSS simple selectors
<?php
/**
* @file
* Functions related to Drupal 7 render arrays.
*/
/**
* Prints out a Drupal render array filtered by a simple selection.
*
@dvessel
dvessel / ns_class.php
Created February 8, 2011 06:18
For resolving 960.gs classes in the NineSixty Drupal theme. (new version)
<?php
/**
* @file
* Functions related resolving grid classes.
*/
// Used by the ns_resolve_class() function.
define('END', 999);
@dvessel
dvessel / RendElements.php
Created March 3, 2011 06:43
RendElements Class
<?php
/**
* Example uses from the page hook when working with a render array.
*
* $elements = new RendElements($page);
*
* Returns a reference to the header. 'header' is the select string.
*
* $header = $elements('header');
@dvessel
dvessel / RecursiveMultiFilterIterator.php
Created March 9, 2011 01:32
Class abstract extended from FilterIterator and implements RecursiveIterator.
<?php
/**
* @file RecursiveMultiFilterIterator.php
* @brief Class abstract extended from RecursiveFilterIterator.
* @author Joon Park (joon@dvessel.com)
*/
/**
* This is an abstract class. Extended it with a custom accept() and/or
@dvessel
dvessel / selectMenu.scpt
Created July 23, 2011 05:25
AppleScript for selecting menu items. Example: selectMenu({"Finder", "file", "new finder window"}) - "Enable access for assistive devices" must be checked in the Universal Access within System Preferences.
-- `selectMenu`, by Jacob Rus, September 2006 modified by Joon Park, 2011
-- Found on http://hints.macworld.com/article.php?story=20060921045743404
--
-- Accepts a list of form: `{"Finder", "View", "Arrange By", "Date"}`
-- Execute the specified menu item. In this case, assuming the Finder
-- is the active application, arranging the frontmost folder by date.
--
-- This will return true or false depending on availability and null if the menu
-- item doesn't exist at all. Use `checkMenu` to only check the state.
@dvessel
dvessel / README.mdown
Last active May 15, 2020 13:18
Sass+Compass, Guard, LiveReload

This will enable Sass+Compass with LiveReload through Guard. (Guard screen cast)

You will also need a browser component to communicate with LiveReload. (browser extension, livereload.js)

If you prefer going through a GUI, that option is available. The following instructions is specific to Mac OS X and it works through the command line.

Note that this is not specific to Rails projects. This can work for any standalone front-end project.

Instructions

@dvessel
dvessel / responsive.html
Created January 27, 2012 05:15 — forked from lensco/responsive.html
Simple responsive design test page. More info here: http://bricss.net/post/16538278376/simple-responsive-design-test-page Modified to follow links.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
@dvessel
dvessel / Set Window….applescript
Created August 13, 2012 00:37
AppleScript for controlling the front window. I use this with LaunchBar.
-- Sets Window size and position for the front most window.
-- Multi-monitor aware, takes arguments.
-- usage: [ center | left | right | full ], [ width x height ]
-- Default Options
property dPosition : "center"
property dWidth : 1066
property dHeight : 1300
@dvessel
dvessel / css-stats-ack.sh
Created September 28, 2012 18:09 — forked from pjkix/css-stats-ack.sh
shell script to generate some css file statistics
#!/bin/bash
## v1.0.6
## this script will gernerate css stats
### example output
# CSS STATS
# ----------
# Floats: 132
@dvessel
dvessel / gist:3881806
Created October 12, 2012 22:00 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete