Skip to content

Instantly share code, notes, and snippets.

View bradbergeron-us's full-sized avatar

Brad Bergeron bradbergeron-us

View GitHub Profile

2D and 3D Block Loaders

A selection of loaders all based around a line of 6 blocks.

Uses CSS3 animation and transforms to create a variety of subtle loading effects.

Inspired by the loading animation on the PSN mobile site (which uses the Flip Delay Up example for their loader).

For more info, see: http://ashleynolan.co.uk/blog/a-collection-of-animated-loaders

/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {

The below configuration will pause the tour after tooltip 2 has appeared (index of 1). In the postStepCallback we check to see if the tour has been paused and fire some code.

<script>
  $(window).load(function() {
    $('#joyRideTipContent').joyride({
      pauseAfter : [1],
      postStepCallback : function (index, tip) {
        if ($(this).joyride('paused')) {
 console.log('Hey there, you\'ve paused the tour.');
@bradbergeron-us
bradbergeron-us / osx.sh
Created April 21, 2015 05:58
Script for Automating ideal osx Settings
# Main
# ====
# Show battery life percentage.
defaults write com.apple.menuextra.battery ShowPercent -string "YES"
# Save screenshots to the downlaods.
defaults write com.apple.screencapture location "$HOME/Downloads/"
@bradbergeron-us
bradbergeron-us / Make_Bin_Executable
Created April 21, 2015 20:31
Makes The entire bin directory executable with a single script
#!/bin/sh
chmod ug+x ~/bin/*
chmod ug+x ~/dotfiles/bin/*
chmod ug+x ~/dotfiles/bin/osx/*
chmod ug+x ~/dotfiles_local/bin/*
chmod ug+x ~/dotfiles_local/bin/osx/*
@bradbergeron-us
bradbergeron-us / Brew_Shipment_OSX.rb
Last active August 29, 2015 14:19
Adds All The Homebrew Packages that I always Forget about in a single Script
#!/usr/bin/env ruby
def parse_package_list(string)
lines = string.split("\n")
active_packages = lines.reject{|package| package =~ /\A\s*\#/}
active_packages.each { |package| package.sub!(/\s*\#.*\Z/, '') }
active_packages
end
brew_packages = parse_package_list(<<-EOD)
@bradbergeron-us
bradbergeron-us / gist:c77b81abc94f6db67ebb
Created April 24, 2015 14:45
NPM and Node with no Sudo
# take ownership of the folders that npm/node use
# please don't do this if you don't know what it does!
sudo mkdir -p /usr/local/{share/man,bin,lib/node,include/node}
sudo chown -R $USER /usr/local/{share/man,bin,lib/node,include/node}
# now just a pretty vanilla node install
# let it use the default paths, but don't use sudo, since there's no need
mkdir node-install
curl http://nodejs.org/dist/node-v0.4.3.tar.gz | tar -xzf - -C node-install
cd node-install/*
@bradbergeron-us
bradbergeron-us / clearfix
Created April 27, 2015 14:02
CSS Clearfiix
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
.clearfix { display: inline-block; }
html[xmlns] .clearfix { display: block; }
* html .clearfix { height: 1%; }
@bradbergeron-us
bradbergeron-us / Pg_DataDump
Last active August 29, 2015 14:22
Use for importing a database -> Add to init shell script then drop into ***/docker-entrypoint-initdb.d *** Start Postgres import via "pg_restore" then "stop database"
#!/bin/bash
: ${DB_USER:=db_user}
: ${DB_PASSWORD:=db_pass}
: ${DB_NAME:=db_name}
: ${DB_ENCODING:=UTF-8}
: ${DB_PG_DUMP_FILE:=/tmp/db.pgdump}
{ gosu postgres postgres --single -jE <<-EOSQL
CREATE USER "$DB_USER" WITH PASSWORD '$DB_PASSWORD';
@bradbergeron-us
bradbergeron-us / Docker_JekyllTemp
Created May 28, 2015 06:23
Template File for Configuring Dockerfile with Jekyll Site
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y git curl nano build-essential libssl-dev libreadline-dev libffi-dev libgdbm-dev
# install ruby
ADD http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.bz2 /
RUN tar xvjf ruby-2.1.2.tar.bz2 && cd ruby-2.1.2 && ./configure --disable-install-doc --with-openssl-dir=/usr/bin && make && make install && cd / && rm -rf /ruby-2.1.2
RUN gem install sass compass jekyll --no-ri --no-rdoc