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 / Chrome.sublime-build
Created April 25, 2013 20:10
Chrome Sublime Text 2 Build System
{
"cmd": ["open", "-a", "Google Chrome", "$file"]
}

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 / vi find and replace
Created September 6, 2016 16:38
vi find and replace
:%s/findme/replaceme/g
@stephenhardy
stephenhardy / gist:ee2b0c1f31b26896179133dff12f7fcf
Created February 21, 2017 00:26
MSSQL Server Find empty tables
select
t.name table_name
from
sys.tables t
join sys.schemas s on (t.schema_id = s.schema_id)
join sys.partitions p on (t.object_id = p.object_id)
where p.index_id in (0,1)
group by t.name,s.name
having sum(p.rows) = 0;
openssl rand -base64 20
@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