Skip to content

Instantly share code, notes, and snippets.

View vjwilson's full-sized avatar

Van Wilson vjwilson

View GitHub Profile
// ----
// Sass (v3.4.3)
// Compass (v1.0.1)
// ----
// Notifications
// =============
.notification {
border-radius: 0.2em;
/*
hsla "Hue Saturation Brightness" + opacity
modified BEM synatx:
top_level_component--substyle
& = "parent class"
*/
.notification {
@vjwilson
vjwilson / gist:802a5a9398b31fbe7654
Last active August 29, 2015 14:06
Rangular: Rails and Angular "Have You Been To"
REST back-end in Rails
front-end app in Angular
Add ng-app attribute to div you want Angular app to control
<div id='container' ng-app='HaveYouBeenTo'>
(Debugging in Chrome JS console: click on element in DOM, and then $0 returns that node in console)
browser object to get current lat/long:
@vjwilson
vjwilson / gist:5b1ea56b7d622cb61ade
Created March 27, 2015 19:23
Convert an Mercurial repo to Git Repo with History, clean up authors, and rename branches
# based on Git docs: http://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git
# in this case, I wanted to make the "stable" branch in Hg repo the "master" branch in Git,
# and remove the "default" branch, so that we could use new Git branches for feature development
git clone http://repo.or.cz/r/fast-export.git /tmp/fast-export
hg clone <path to Hg repo> /tmp/hg-repo
cd /tmp/hg-repo
hg log | grep user: | sort | uniq | sed 's/user: *//' > ../authors
vim ../authors # clean up author references
@vjwilson
vjwilson / gist:d7f887b75543a9e5477b
Created April 25, 2015 19:08
Sample .bash_profile on Mac OS X
HISTFILESIZE=1000000000 HISTSIZE=100000
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
@vjwilson
vjwilson / gist:1a7a171313c30655da08
Last active February 28, 2016 12:22
Sample .gitconfig
[user]
name = Van J. Wilson
email = van.wilson1992@alumni.unc.edu
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
dc = diff --cached
@vjwilson
vjwilson / Gemfile
Last active June 11, 2016 22:15
Sinatra app for working with Github Gist API
source 'https://rubygems.org'
gem 'sinatra'
gem 'octokit'
@vjwilson
vjwilson / README.md
Last active September 24, 2016 14:39
Bare-bones Webpack config

Do-it-yourself React with Webpack

Between reinventing the wheel to make your own Webpack build of a React app, and using a "starter kit" or template, there is this option.

I think this make it easier to wrap your head around the meat of what Webpack does.

  1. Start with a bare-bones working Webpack configuration, that builds a working React app you can see right away.
  2. Make incremental tweaks and additions to learn-as-you-go.

Because gists cannot show directory structure, I could not show that you put the app.js file in a subdirectory named src/.

@vjwilson
vjwilson / pre-commit
Created September 28, 2016 12:41
Git pre-commit hook
#!/bin/sh
if git rev-parse --verify HEAD >/dev/null 2>&1; then
against=HEAD
else
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
echo 'Checking against ref ' $against
@vjwilson
vjwilson / index.html
Created January 11, 2017 00:15
First file for Git Basics
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>