Skip to content

Instantly share code, notes, and snippets.

View whazzmaster's full-sized avatar
:shipit:
Re-architect the world

Zachery Moneypenny whazzmaster

:shipit:
Re-architect the world
View GitHub Profile
@whazzmaster
whazzmaster / git-prompt++
Created April 4, 2011 01:54
dotfile methods for showing the current branch name and minutes since last commit (or 'clean' if working directory has no changes)
function minutes_since_last_commit {
now=`date +%s`
last_commit=`git log --pretty=format:'%at' -1`
seconds_since_last_commit=$((now-last_commit))
minutes_since_last_commit=$((seconds_since_last_commit/60))
echo $minutes_since_last_commit
}
function has_modified_files {
status=`git status`
@whazzmaster
whazzmaster / cross-project-status.sh
Created April 26, 2011 04:30
Shell function that shows a summary of all your current projects
function minutes_since_last_commit {
now=`date +%s`
last_commit=`git log --pretty=format:'%at' -1`
seconds_since_last_commit=$((now-last_commit))
minutes_since_last_commit=$((seconds_since_last_commit/60))
echo $minutes_since_last_commit
}
function has_modified_files {
status=`git status`
@whazzmaster
whazzmaster / design.css.scss
Created June 30, 2011 00:18
AXLE OOCSS Framework grid port (LESS to SCSS)
.grid-1 { @include grid_12(1); }
.grid-2 { @include grid_12(2); }
.grid-3 { @include grid_12(3); }
.grid-4 { @include grid_12(4); }
.grid-5 { @include grid_12(5); }
.grid-6 { @include grid_12(6); }
.grid-7 { @include grid_12(7); }
.grid-8 { @include grid_12(8); }
.grid-9 { @include grid_12(9); }
.grid-10 { @include grid_12(10); }
@whazzmaster
whazzmaster / .fitgem.yml
Last active January 30, 2019 10:54
Bench-test script for playing around with the Fitbit API and fitgem in using Ruby. For more information see http://fitbitclient.com
oauth:
consumer_key: "your consumer key here"
consumer_secret: "your consumer secret here"
ssl: true
@whazzmaster
whazzmaster / js-mvc-discussion.md
Last active December 17, 2015 12:59
Mad-Railers Javascript Discussion May 20th, 2013

There and Back Again

Rails' Relationship with Javascript Through the Years

Rails 1.0 (2005)

You'll use prototype and script.aculo.us and like it!

@whazzmaster
whazzmaster / create_labels.sh
Last active January 8, 2016 20:52 — forked from omegahm/create_labels.sh
Create Gtihub labels from Bash
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform
@whazzmaster
whazzmaster / migration.exs
Last active August 14, 2017 14:35
Non-primary key UUIDs in Phoenix
defmodule MyApp.Repo.Migrations.AddTrackerIdToProperty do
use Ecto.Migration
def change do
alter table :properties do
add :tracker_id, :uuid, default: fragment("uuid_generate_v4()")
end
end
end
@whazzmaster
whazzmaster / keybindings.json
Last active November 21, 2022 09:06
Test tasks for Visual Studio Code and Elixir
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+t cmd+t",
"command": "workbench.action.tasks.runTask",
"args": "Run All Tests"
},
{
"key": "f5",
"command": "workbench.action.tasks.runTask",
@whazzmaster
whazzmaster / test.exs
Last active August 18, 2017 15:18
Test environment bcrypt configuration
use Mix.Config
# ... rest of config ...
config :comeonin, :bcrypt_log_rounds, 4
scalar :time, description: "ISOz time" do
parse &Timex.DateFormat.parse(&1.value, "{ISOz}")
serialize &Timex.DateFormat.format!(&1, "{ISOz}")
end