Skip to content

Instantly share code, notes, and snippets.

View dsandstrom's full-sized avatar

Darrell Sandstrom dsandstrom

View GitHub Profile
@dsandstrom
dsandstrom / foundation-chosen.sass
Last active June 3, 2018 05:55
Foundation 5 and Chosen CSS Merger
// Foundation and Chosen CSS Merger
// ZURB Foundation v5 - Harvest Chosen v1.1
// Add to the bottom of foundation_and_overrides.scss: `@import 'foundation-chosen';`
$chosen-form-spacing: $form-spacing / 4 + rem-calc(1)
$chosen-input-height: ($input-font-size + ($form-spacing * 1.5) - rem-calc(1))
$chosen-input-height-multi: ($input-font-size + ($form-spacing * 1.5) - rem-calc(5))
$chosen-border-radius: 0
$chosen-highlighted: $primary-color

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

# Sublime plugin
# Save file: Packages/CloseProjectAndExit/close_project_and_exit.py
# Copy to keymap: { "keys": ["ctrl+shift+`"], "command": "close_project_and_exit" }
import sublime
import sublime_plugin
class CloseProjectAndExitCommand(sublime_plugin.WindowCommand):
def run(self):
@dsandstrom
dsandstrom / conky_pacman.rb
Last active July 15, 2017 15:38
Ruby script to list packages with update with conky. Uses `pacman -Qu` to retrieve packages with updates and organizes per package importance. Add a hourly cron job that runs `pacman -Sy`. Recommend conky config: http://walkero.gr/post/50586862655/my-latest-conky-script
#!/usr/bin/env ruby
# Add ${execpi 3600 path/to/conky_pacman.rb} to the bottom of ~/.conkyrc
# TODO: use regex to match package ratings (linux*)
CONKY_WIDTH = 35
MAX_PACKAGES = 8
COLOR_INFO = '#FFFFFF'
COLOR_HIGH = '#FF0000'
COLOR_MED = '#FFFF00'
@dsandstrom
dsandstrom / subl
Last active June 23, 2016 11:23
Bash script to open Sublime Text project. Defaults to opening current directory if no file given. If file/folder given, opens that.
#!/bin/bash
if [ "$#" -eq "0" ] ; then
for file in *sublime-project
do
if [ -f $file ] ; then
# if no arguments, find if there is a project file in the current directory
filename="${file%.*}"
echo "Opening project: $filename"
/opt/sublime_text_2/sublime_text --class=sublime-text-2 -n $file &
@dsandstrom
dsandstrom / fuubar.sh
Last active December 17, 2015 13:38
Shell script that runs RSpec Ruby tests in Fuubar format.
#!/bin/bash
# Fuubar format RSpec
# `fuubar` - runs all tests in spec/
# `fuubar [path/from/spec]` - if the folder or file is found, runs tests in that folder/file
# also guesses where the file is located based on the partial file name
# examples:
# ---
# `fuubar user` - runs spec/models/user_spec.rb