Permalink
Browse files

updated some files to markdown

  • Loading branch information...
1 parent 6211482 commit b9820960915fd1d63c168822766c85626043efba @underhilllabs committed May 11, 2012
@@ -1,50 +0,0 @@
----
-layout: post
-title: Vim Tip Yanking or Deleting a Big Chunk of Text
-tags: vim mysql webdev
-category: Vim
----
-
-I have a large mysqldump backup file of all databases on a server but I need a sql backup for a single database. So I wanted to break up the dump file into smaller pieces. This is one solution I came up with using vim.
-
-1. I opened the dump file and a newly created file for the single database:
-
-{% highlight bash %}
-vim db-dump.sql newdumpfile.sql
-{% endhighlight %}
-
-2. I searched for the start of the database section by searching for:
-{% highlight bash %}
-/USE `databasename`
-{% endhighlight %}
-where "databasename" is the specific database I want to grab.
-
-3. Once I was at the correct spot in the database dump I noticed that each individual database section starts with a comment:
-{% highlight bash %}
----
---- Current Database: `databasename`
----
-{% endhighlight %}
-Once again, "databasename" is a specific database name.
-
-4. So I yanked all lines until the next database section with the following vim command:
-{% highlight bash %}
-y/Current Database/
-{% endhighlight %}
-
-This tells vim to yank all lines until it reaches the next match for the regular expression "Current Database". Vim will report how many lines have been yanked.
-
-5. Next, switch to the new file and paste the lines that were yanked.
-{% highlight bash %}
-:bn
-p
-{% endhighlight %}
-
-The vim command :bn, means switch to the next buffer. You could also run the command ":e newdumpfile.sql" to create and edit a new sql file. The next vim command "p" is the paste command, it pastes into the current buffer the last yanked hunk of text. In this case it would be the lines you just yanked, the single database dump.
-
-6. Finally save the changes to the new file with :wq
-
-7. If you'd like to reload the database into mysql use the following:
-{% highlight bash %}
-mysql -p < newdumpfile.sql
-{% endhighlight %}
@@ -0,0 +1,63 @@
+---
+layout: post
+title: More Git Goodness
+tags: git
+category: Git
+---
+
+## Git Show
+
+### Show a particular commit with git show
+
+
+This will show the commit as a diff.
+
+{% highlight bash %}
+git show HEAD^^^
+{% endhighlight %}
+
+Also you can use the commit's sha1 as an argument
+{% highlight bash %}
+git show 62114826e3f
+{% endhighlight %}
+
+
+
+
+## Set git to output color
+
+{% highlight bash %}
+git config --local color.ui auto
+{% endhighlight %}
+
+
+This command adds the following to your .gitconfig file:
+
+{% highlight yaml %}
+[color]
+ ui = auto
+{% endhighlight %}
+
+
+
+## Git Bisect
+
+Try to find where in the version history a bug first appeared.
+
+{% highlight bash %}
+# start bisect
+git bisect start
+# set good point: there was no bug here, this can be a tag, SHA1, or HEAD~18 ...
+git good v1.2.6
+# set bad endpoint: we know it had shown up by here
+git bad master
+
+# bisect will select a commit half way between good and bad
+# test ... then tell git if its good or bad
+git bisect good
+# it will split the other half in half
+git bisect bad
+# when you've found the bad commit, reset the branch with
+git biset reset
+
+{% endhighlight %}
@@ -1 +1,28 @@
-If you've ever played keywiz on Emacs: "M-x keywiz", you were probably eating humble-hacker-pie by the end of the game. (For the uninitiated, keywiz is a game in emacs that's asks 10 random questions about key-bindings for some times obscure emacs commands.) So far my top score is 4 (out of 10).<br /><br />So what is a novice to do? I've decided to write commands I want to learn on sticky notes on my monitor until I memorize them.<br /><br />So, without further ado, here's this weeks list of new commands:<br /><br />M-g g<br />goto line. This command will ask for a line number and take you there in the current file.<br /><br />C-x v=<br />vc-diff. This command will show a diff between current file and HEAD in whatever Version Control System you are using.<br /><br />C-x vv<br />vc-next-action. This command will perform the next appropriate VCS command, such as add current file to staging, or commit.<br /><br />C-M-\<br />indent-region. If there is a defined region, this command will indent it.<br /><br />C-M-;comment-region. If there is a defined region, this command will comment the region out. (or uncomment a commented out region.)<br /><br />A note: to define a region. Do a C-[spc] at the beginning of the region and then move to the end of the region however you'd like (arrow keys, C-n, C-f, C-v). If you can't see the regions add the following to your .emacs file: (transient-mark-mode 1).<br /><br />Second note, in the above key combination, capital C, means hold the Ctrl key, capital M, means hold the Alt key. If there are dashes between letters: type them together (or with C or M hold the Ctrl or Alt key while typing the other key. So with M-g g: Hold Alt while typing g, let go and then type g again.)<br /><br />Now off to work on a new version of keywiz, perhaps keywiz-jr!<br /><br /><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7035860407900002000-8672382218947955063?l=denverdroid.blogspot.com' alt='' /></div>
+If you've ever played keywiz on Emacs: "M-x keywiz", you were probably eating humble-hacker-pie by the end of the game. (For the uninitiated, keywiz is a game in emacs that's asks 10 random questions about key-bindings for some times obscure emacs commands.) So far my top score is 4 (out of 10).
+
+So what is a novice to do? I've decided to write commands I want to learn on sticky notes on my monitor until I memorize them.
+
+So, without further ado, here's this weeks list of new commands:
+
+M-g g
+goto line. This command will ask for a line number and take you there in the current file.
+
+<h3>C-x v=</h3>
+vc-diff. This command will show a diff between current file and HEAD in whatever Version Control System you are using.
+
+<h3>C-x vv</h3>
+vc-next-action. This command will perform the next appropriate VCS command, such as add current file to staging, or commit.
+
+<h3>C-M-\</h3>
+indent-region. If there is a defined region, this command will indent it.
+
+<h3>C-M-;</h3>
+comment-region. If there is a defined region, this command will comment the region out. (or uncomment a commented out region.)
+
+A note: to define a region. Do a C-[spc] at the beginning of the region and then move to the end of the region however you'd like (arrow keys, C-n, C-f, C-v). If you can't see the regions add the following to your .emacs file: (transient-mark-mode 1).
+
+Second note, in the above key combination, capital C, means hold the Ctrl key, capital M, means hold the Alt key. If there are dashes between letters: type them together (or with C or M hold the Ctrl or Alt key while typing the other key. So with M-g g: Hold Alt while typing g, let go and then type g again.)
+
+Now off to work on a new version of keywiz, perhaps keywiz-jr!
+
+<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7035860407900002000-8672382218947955063?l=denverdroid.blogspot.com' alt='' /></div>

0 comments on commit b982096

Please sign in to comment.