Skip to content

Instantly share code, notes, and snippets.

View vgdub's full-sized avatar
💭
🤓

Vincent Williams vgdub

💭
🤓
View GitHub Profile
@vgdub
vgdub / bash_profile
Created August 16, 2012 22:45
.bash_profile
export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ →\ \1/'
}
export PS1='\u\[\e[1;37m\]@\[\e[1;32m\]\h\[\e[1;37m\]:\[\e[1;31m\]\W\[\e[1;33m\]$(parse_git_branch)\[\e[0;39m\]> '
export PROMPT_COMMAND='echo -ne "\033]0;${PWD}\007"'
@vgdub
vgdub / sorcery_external_instagram.rb
Created September 15, 2013 22:01
Sorcery instagram external oauth module
module Sorcery
module Controller
module Submodules
module External
module Providers
# This module adds support for OAuth with instagram.com.
# When included in the 'config.providers' option, it adds a new option, 'config.instagram'.
# Via this new option you can configure Instagram specific settings like your app's key and secret.
#
# config.instagram.key = <key>
@vgdub
vgdub / gist:7295802
Created November 3, 2013 22:53
Dual request logs in development running webrick. No issues running unicorn.
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
I, [2013-11-03T16:44:06.697500 #83624] INFO -- : ** [Raven] Raven 0.6.0 ready to catch errors
[2013-11-03 16:44:06] INFO WEBrick 1.3.1
[2013-11-03 16:44:06] INFO ruby 2.0.0 (2013-06-27) [x86_64-darwin12.3.0]
[2013-11-03 16:44:06] INFO WEBrick::HTTPServer#start: pid=83624 port=3000
@vgdub
vgdub / 0_reuse_code.js
Created February 14, 2014 03:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@vgdub
vgdub / Gemfile
Created February 24, 2014 22:56 — forked from cblunt/Gemfile
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL

Keybase proof

I hereby claim:

  • I am vgdub on github.
  • I am vgdub (https://keybase.io/vgdub) on keybase.
  • I have a public key whose fingerprint is 2D12 A339 E6ED CEA3 4B52 2958 6CBD 916E B65E FF60

To claim this, I am signing this object:

@vgdub
vgdub / nav-toggle.css
Created March 31, 2014 01:03
Nav Toggle Icon
.nav_toggle{display:inline-block;position:absolute;top:0;left:0;padding:1.5em .75em;transition:.5s;cursor:pointer;-webkit-user-select:none;user-select:none;opacity:.9;}
.nav_toggle .nav_toggle__icon:before,.nav_toggle .nav_toggle__icon:after{transition:.25s}
.nav_toggle__icon{position:relative;width:2.5em;height:.25em;background:#fff;font-size:.75em;transition:.5s;border-radius:2.5em;}
.nav_toggle__icon:after,.nav_toggle__icon:before{display:block;content:"";height:.25em;width:2.5em;background:#fff;position:absolute;z-index:-1;transition:.5s .25s;border-radius:1em}
.nav_toggle__icon:after{top:-.825em}
.nav_toggle__icon:before{top:.825em}
.nav_toggle-active{left:13em;}
.nav_toggle-active:before{content:"";position:absolute;top:0;left:3.25em;width:40em;height:30em}
.nav_toggle-active .nav_toggle__icon:before,.nav_toggle-active .nav_toggle__icon:after{transition:.5s;top:0}
.nav_toggle-active .nav_toggle__icon{background:transparent;}
@vgdub
vgdub / ng-textcomplete.min.js
Created April 30, 2014 23:16
textcomplete angular
"use strict";angular.module("ngTextcomplete",[]).factory("utils",[function(){function lock(func){var free,locked;free=function(){locked=false};return function(){var args;if(locked)return;locked=true;args=toArray(arguments);args.unshift(free);func.apply(this,args)}}function toArray(args){return Array.prototype.slice.call(args)}function bind(func,context){return func.bind?func.bind(context):function(){func.apply(context,arguments)}}var getStyles=function(){var color;color=$("<div></div>").css(["color"]).color;if(typeof color!=="undefined"){return function($el,properties){return $el.css(properties)}}else{return function($el,properties){var styles;styles={};angular.forEach(properties,function(property,i){styles[property]=$el.css(property)});return styles}}}();function memoize(func){var memo={};return function(term,callback){if(memo[term]){callback(memo[term])}else{func.call(this,term,function(data){memo[term]=(memo[term]||[]).concat(data);callback.apply(null,arguments)})}}}function include(array,value){var i,l;if
@vgdub
vgdub / templates.js.erb
Created May 27, 2014 18:53
template_cache_rails_assets_angular.js.erb
'use strict';
angular.module('templates', []).run([ '$templateCache', function($templateCache) {
<%
environment.context_class.instance_eval { include ActionView::Helpers::JavaScriptHelper }
app_root = File.expand_path('../', __FILE__)
html_templates = File.join(app_root, %w{templates ** ** *.html })
templates = Dir.glob(html_templates)
@vgdub
vgdub / httpInteceptor.coffee
Created June 25, 2014 17:08
http angular inteceptor for loading spinner
angular.module('matchupApp').config ['$httpProvider', ($httpProvider) ->
$httpProvider.interceptors.push ['$log', '$rootScope', ($log, $rootScope) ->
requestCount = 0
processIsLoading = (adjustment) ->
requestCount += adjustment
isStillLoading = requestCount > 0
$rootScope.loading = isStillLoading
isStillLoading
request = (config) ->