Skip to content

Instantly share code, notes, and snippets.

openssl rand -base64 20
@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;
@stephenhardy
stephenhardy / vi find and replace
Created September 6, 2016 16:38
vi find and replace
:%s/findme/replaceme/g
@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 / 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 / mysqldump utf8
Created April 14, 2016 12:07
mysqldump utf8
mysqldump -u username -p --default-character-set=utf8 --result-file=dumpFile.sql databaseName
@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

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