Skip to content

Instantly share code, notes, and snippets.

@rdebeasi
rdebeasi / tinygrid.less
Last active December 15, 2015 20:59
Simple tiny-screen grid system for use alongside Bootstrap 2. Bootstrap 3 will have a built-in small device grid, but if you can't wait for that, Tiny Grid might be able to hold you over.
/* Simple 4-col tiny grid - designed as a companion to the Bootstrap grid
Overrides Bootstrap's default stacking behavior for "tiny" devices (<=400px).
Feel free to change this breakpoint to match your needs - 767px is probably a more natural fit with Bootstrap defaults.
Made with love in PROD - http://www.prod4ever.com/ */
@import "variables.less";
@import "mixins.less";
/* Utility Classes
Tiny grid is a subest of the phone grid, so visible-phone and hidden-phone apply to tiny devices as well. */
@rdebeasi
rdebeasi / grid-no-gutter.less
Last active December 16, 2015 13:48
This tweak allows you to remove gutters from some columns in Bootstrap 2 while leaving margins on other columns intact. (To remove gutters from all columns, just change the column and gutter variables in variables.less).
@import "mixins.less";
@import "variables.less";
.grid-no-gutter {
/* Removes margin from Bootstrap Grid. This class goes at least one level above row-fluid.
Works in Bootstrap 2. In Bootstrap 3, #grid has been removed. */
#grid > .fluid( percentage( 1 / @gridColumns ), 0 );
}
@rdebeasi
rdebeasi / .profile
Last active December 16, 2015 14:59
Bash profile with git sync command (see https://gist.github.com/rdebeasi/5155522) and virtual host setup command. Uses MAMP and Sublime Text.
export PATH=/opt/subversion/bin:~/bin:/opt/local/bin:/opt/local/sbin:~/Documents/util/scripts:$PATH
# Pyhton virtualenv
export WORKON_HOME=~/Envs
source /usr/local/bin/virtualenvwrapper.sh
# Use Sublime Text as editor
export EDITOR='subl -w'
# Commands
alias gs='gsync.sh'
alias vhost='subl /etc/hosts /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf'
@rdebeasi
rdebeasi / override-bootstrap-breakpoint.less
Last active December 19, 2015 00:49
Override Bootstrap's default breakpoint for stacking to 1 column. Hopefully we'll be able to change this with a variable in Bootstrap 3.
@import "mixins.less";
@import "variables.less";
@media (min-width: 400px) and (max-width: 767px) {
/* Restore standard bootstrap grid for medium-sized devices. */
#grid > .fluid(@fluidGridColumnWidth768, @fluidGridGutterWidth768);
}
@rdebeasi
rdebeasi / nth-child.css
Created July 2, 2013 19:56
Counting with nth-child
:nth-child(4n+1) {} /* - For 1, 5, 9, 13...*/
:nth-child(4n-2) {} /* For 2, 6, 10, 14... */
:nth-child(4n-1) {} /* For 3, 7, 11, 15... */
:nth-child(4n) {} /* For 4, 8, 12, 16... */
@rdebeasi
rdebeasi / gotime.sh
Last active December 23, 2015 00:48
Simple deployment script for a Django app running on Heroku. This will commit and push any changes you've made to static files, so be sure to run git status before running this command.
#!/bin/sh
echo "~*~*~ IT'S GO TIME!!! ~*~*~"
echo "Collecting static files..."
python manage.py collectstatic --noinput
echo "Adding & committing..."
git add staticfiles
git commit -m "Collected static files."
# If the push to origin fails, abort the script. It's ok if the commit fails: the user might not have had any static file changes to commit.
set -e
@rdebeasi
rdebeasi / shelve
Last active May 16, 2016 08:01
Simple equivalent of "git stash" for Subversion
#!/bin/sh
# Simple equivalent of "git stash" in Subversion.
# This doesn't require creating branches (which can get messy) or using patches
# (which doesn't work if a visual diff tool is configured).
# More ideas: http://stackoverflow.com/q/1554278/925475
# If any comamand fails, abort the script.
set -e
@rdebeasi
rdebeasi / posts-to-taxonomies.sh
Created October 27, 2017 21:12
Convert Hugo posts to taxonomies
#!/bin/bash
# Run this in the directory containing the content type that you'd like to move.
# This script moves each markdown file into a new directory of the same name and renames the file to _index.md.
# You'll also need to add the taxonomy to config.toml.
FILES=*.md
for file in $FILES
do
filename="${file%%.*}"
if [ "$filename" == "_index" ]; then
# This file follows the WordPress CSS standards as closely as possible. For any
# linters that aren't listed in this file, we're accepting the default settings.
# https://make.wordpress.org/core/handbook/best-practices/coding-standards/css/
# Linter documentation: http://git.io/vG7gu
# See also: http://sass-guidelin.es/
linters:
Comment:
@rdebeasi
rdebeasi / event-storming.md
Last active May 17, 2018 13:30
Notes for running an event storming workshop

From a whiteboard that someone wrote in Boston:

  1. Establish goal & context
  2. Users/functional roles
  3. Important steps on timeline? (step)
  4. What does the button say? (command)
  5. What does the button do? (event)
  6. What data do you need to successfully press the button? (aggregate)
  7. Is there a UI for this? (view)