Skip to content

Instantly share code, notes, and snippets.

View todgru's full-sized avatar

todgru

  • Portland, OR
View GitHub Profile
@todgru
todgru / curl.md
Last active December 9, 2015 19:09
Notes about curl CURL cURL

#Bash and Curl

###cURL

Record an mp3 stream to a file:

$ curl http://example.com/stream.mp3 -o file.mp3

http://stream1.opb.org/kmhd_web.mp3

@todgru
todgru / ci_query.md
Created December 19, 2012 00:13
CI queries bindings code igniter
@todgru
todgru / git_revert.md
Created December 20, 2012 01:20
how to use git revert --strategy resolve

Oh yes, this is nice:

git revert --strategy resolve <sha-ish>

Given a git log of A--B--C--D--E you can remove commit C using:

git revert --strategy resolve <sha-of-C> 

Which will produce:

@todgru
todgru / mysql.md
Last active December 10, 2015 01:19
mysql sql command line cli dump backup restore tips tricks etc

#MySQL

run mysql cli:

mysql -u [username] -p [databasename]

will prompt for password.

show databases;
use [databasename];
@todgru
todgru / git_amend.md
Last active December 10, 2015 01:48
change last git commit message amend

#git commit --amend

Use this to change the last commits message:

git commit --amend -m "New commit message"

@todgru
todgru / 1scp.md
Last active September 24, 2020 18:14
scp rsync
@todgru
todgru / rest_example.md
Last active December 10, 2015 03:38
Example of a truly RESTful api rest hateoas HATEOAS
@todgru
todgru / grep.md
Last active January 11, 2023 16:49
grep find string between line numbers, before after

grep

-A lines after find -B lines before find -n number the lines of the file and display that number before each result(s)

$ grep -A20 -B20 -n 'this is what im looking for' filnameToSearch.txt

@todgru
todgru / coffee-pour-over.md
Last active December 10, 2015 16:58
Pour over coffee method
@todgru
todgru / vim_info.md
Last active January 22, 2019 01:23
vim nerdtree copy paste search and replace

#vim

Editing

  • shift V select line, up or down select lines
  • shift > shift select block or line out
  • shift < shift select block or line in
  • d to delete highlighted text and copy to cliboard
  • D delete everything after cursor to end of line
  • y to copy (yank)