Skip to content

Instantly share code, notes, and snippets.

@stephenhardy
stephenhardy / gist:804134
Created January 31, 2011 15:02
My current .vimrc customisations
"##############################################################################
"# My additions and configurations below
"##############################################################################
set nocompatible
" Remove any chrome, toolbars etc
if has("gui_running")
set guioptions-=m
set guioptions-=T
@stephenhardy
stephenhardy / setupGithubRepo
Created April 24, 2013 21:18
Initial setup steps for a git and github project
-- Initial setup
mkdir <YOURPROJECT>
cd <YOURPROJECT>
git init
-- Link to GitHub hosted repos
git remote add origin <git@github.com:YOURACCOUNT/YOURREPO.git>
git pull origin master
@stephenhardy
stephenhardy / Chrome.sublime-build
Created April 25, 2013 20:10
Chrome Sublime Text 2 Build System
{
"cmd": ["open", "-a", "Google Chrome", "$file"]
}
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git

I wrote this in early January 2012, but never finished it. The research and thinking in this area led to a lot of the design of Yeoman and talks like "Javascript Development Workflow of 2013", "Web Application Development Workflow" and "App development stack for JS developers" (surpisingly little overlap in those talks, btw).

Now it's June 2013 and the state of web app tooling has matured quite a bit. But here's a snapshot of the story from 18 months ago, even if a little ugly and incomplete. :p


In the beginning…

  • Intro to tooling
@Grab(group = 'com.fasterxml.jackson.dataformat', module= 'jackson-dataformat-csv', version = '2.3.0')
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonPropertyOrder
import com.fasterxml.jackson.core.JsonFactory
import com.fasterxml.jackson.dataformat.csv.CsvMapper
import com.fasterxml.jackson.dataformat.csv.CsvSchema
import com.fasterxml.jackson.databind.MappingIterator
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.ObjectWriter
@stephenhardy
stephenhardy / mysqldump utf8
Created April 14, 2016 12:07
mysqldump utf8
mysqldump -u username -p --default-character-set=utf8 --result-file=dumpFile.sql databaseName
@stephenhardy
stephenhardy / findTablesWithColumnsMySQL.sql
Created May 30, 2016 10:41
Find all mysql database tables with specific column names
SELECT DISTINCT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME IN ('columnA','ColumnB')
AND TABLE_SCHEMA='YourDatabase';
@stephenhardy
stephenhardy / Rsync to or from remote
Created September 6, 2016 10:42
Rsync to or from remote
To remote
-----------
rsync -azP file username@remote_host:/home/dir/file
From remote
-------------
rsync -azP username@remote_host:/home/dir/file file
@stephenhardy
stephenhardy / vi find and replace
Created September 6, 2016 16:38
vi find and replace
:%s/findme/replaceme/g