Skip to content

Instantly share code, notes, and snippets.

View dgowrie's full-sized avatar
🤘

David Gowrie dgowrie

🤘
View GitHub Profile
@dgowrie
dgowrie / css-stats-ack.sh
Created October 1, 2012 20:06 — forked from pjkix/css-stats-ack.sh
shell script to generate some css file statistics
#!/bin/bash
## v1.0.6
## this script will gernerate css stats
### example output
# CSS STATS
# ----------
# Floats: 132
@dgowrie
dgowrie / index.html
Last active August 29, 2015 14:11 — forked from jonnyreeves/index.html
RequireJS demo: OO JavaScript - a 'prototype pattern' modular approach to "Class" definitions. "JavaScript Class Structure using requireJS. The following code shows you how to create a Class definition in one JavaScript file and then import it for use in another."
<!DOCTYPE html>
<html>
<head>
<script data-main="usage" src="http://requirejs.org/docs/release/2.1.15/comments/require.js"></script>
</head>
<body>
<p>Check your JavaScript console for output!</p>
</body>
</head>
@dgowrie
dgowrie / Gruntfile.js
Last active August 29, 2015 14:14 — forked from jamesshore/Gruntfile.js
Michal Svoboda's port of [Automatopia](https://github.com/jamesshore/automatopia) to Grunt. See [this comment thread](http://www.letscodejavascript.com/v3/comments/lab/1#comment-1206272962) for context.
/* global module */
(function() {
"use strict";
module.exports = function(grunt) {
var shellOptions = { stdout: true, stderr: true, failOnError: true };

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@dgowrie
dgowrie / git-feature-workflow.md
Last active August 29, 2015 14:27 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow

There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.

The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.

When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].

Basic branching

When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.

@dgowrie
dgowrie / gist:674b7b31e2f91c244fc7
Created March 24, 2016 16:36 — forked from pgoldrbx/gist:d730cda13de64db69175
This ___ isn't working... did I do something dumb?

Why aren't I seeing my changes?

What do you mean 404 error?!?

Oh come ON, I just DID that!

How often are you working on something and are stuck trying to debug some irritation problem, only to discover after time that you've done something embarrassingly stupid? It's good to go through a checklist of "dumb" questions before spending an hour in the debugger or pouring over changesets.

Example:

  • Is the computer plugged in? (classic tech support!)
@dgowrie
dgowrie / gist:41b7146b5f0f61780dd988a290f0b932
Created June 15, 2017 17:23 — forked from davisford/gist:5039064
git clone into non-empty directory

Let's say you start a project locally, and do some editing.

$ mkdir -p ~/git/foo && cd ~/git/foo
$ touch NEWFILE

Now you decide you want to create a new github repo and track it, but the directory is non-empty so git won't let you clone into it. You can fix this, thusly:

@dgowrie
dgowrie / app.js
Created June 29, 2017 14:05 — forked from verticalgrain/app.js
React Router V4 Redirect after form submission
import React, { Component } from 'react'
import { Redirect } from 'react-router'
export default class ContactForm extends Component {
constructor () {
super();
this.state = {
fireRedirect: false
}
}
@dgowrie
dgowrie / Tab.js
Created July 4, 2017 19:37 — forked from diegocasmo/Tab.js
Source code for implementing a React <Tabs/> component.
import React, {PropTypes} from 'react';
export const Tab = (props) => {
return (
<li className="tab">
<a className={`tab-link ${props.linkClassName} ${props.isActive ? 'active' : ''}`}
onClick={(event) => {
event.preventDefault();
props.onClick(props.tabIndex);
}}>
var ReactTable = React.createClass({
getInitialState: function() {
return {currentData: this.props.data};
},
render: function() {
var key = Date.now();