summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_config.yml1
-rw-r--r--_posts/2009-10-16-post-receive-hooks.markdown85
-rw-r--r--_posts/2010-01-19-multiple-keys.markdown14
-rw-r--r--_posts/2010-03-02-changing-author-info.markdown7
-rwxr-xr-xcss/style.css6
5 files changed, 103 insertions, 10 deletions
diff --git a/_config.yml b/_config.yml
index ccdbafb..3117754 100644
--- a/_config.yml
+++ b/_config.yml
@@ -1,3 +1,4 @@
permalink: /:title
auto: true
server: true
+pygments: true \ No newline at end of file
diff --git a/_posts/2009-10-16-post-receive-hooks.markdown b/_posts/2009-10-16-post-receive-hooks.markdown
index c971a31..25db1e8 100644
--- a/_posts/2009-10-16-post-receive-hooks.markdown
+++ b/_posts/2009-10-16-post-receive-hooks.markdown
@@ -17,19 +17,98 @@ What we'll send is JSON containing information about the push and the commits in
Here's the template we use in Ruby to generate the JSON:
-<script src="http://gist.github.com/212213.js"> </script>
+{% highlight ruby %}
+{
+ :before => before,
+ :after => after,
+ :ref => ref,
+ :commits => [{
+ :id => commit.id,
+ :message => commit.message,
+ :timestamp => commit.committed_date.xmlschema,
+ :url => commit_url,
+ :added => array_of_added_paths,
+ :removed => array_of_removed_paths,
+ :modified => array_of_modified_paths,
+ :author => {
+ :name => commit.author.name,
+ :email => commit.author.email
+ }
+ }],
+ :repository => {
+ :name => repository.name,
+ :url => repo_url,
+ :pledgie => repository.pledgie.id,
+ :description => repository.description,
+ :homepage => repository.homepage,
+ :watchers => repository.watchers.size,
+ :forks => repository.forks.size,
+ :private => repository.private?,
+ :owner => {
+ :name => repository.owner.login,
+ :email => repository.owner.email
+ }
+ }
+}
+{% endhighlight %}
This is sent as a POST with a single parameter: 'payload'
So, for example, you'd do something like this in a [Sinatra](http://sinatra.rubyforge.org/) server:
-<script src="http://gist.github.com/212212.js"> </script>
+{% highlight ruby %}
+post '/' do
+ push = JSON.parse(params[:payload])
+ "I got some JSON: #{push.inspect}"
+end
+{% endhighlight %}
The `commits` array is ordered with the most recent commit as the first element. The last element, therefor, is the oldest commit.
Here's an example payload:
-<script src="http://gist.github.com/212211.js"> </script>
+{% highlight javascript %}
+{
+ "before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
+ "repository": {
+ "url": "http://github.com/defunkt/github",
+ "name": "github",
+ "description": "You're lookin' at it.",
+ "watchers": 5,
+ "forks": 2,
+ "private": 1,
+ "owner": {
+ "email": "chris@ozmm.org",
+ "name": "defunkt"
+ }
+ },
+ "commits": [
+ {
+ "id": "41a212ee83ca127e3c8cf465891ab7216a705f59",
+ "url": "http://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
+ "author": {
+ "email": "chris@ozmm.org",
+ "name": "Chris Wanstrath"
+ },
+ "message": "okay i give in",
+ "timestamp": "2008-02-15T14:57:17-08:00",
+ "added": ["filepath.rb"]
+ },
+ {
+ "id": "de8251ff97ee194a289832576287d6f8ad74e3d0",
+ "url": "http://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
+ "author": {
+ "email": "chris@ozmm.org",
+ "name": "Chris Wanstrath"
+ },
+ "message": "update pricing a tad",
+ "timestamp": "2008-02-15T14:36:34-08:00"
+ }
+ ],
+ "after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
+ "ref": "refs/heads/master"
+}
+{% endhighlight %}
For more information on this technique, see the [Web Hooks Wiki](http://webhooks.pbwiki.com/).
diff --git a/_posts/2010-01-19-multiple-keys.markdown b/_posts/2010-01-19-multiple-keys.markdown
index fc82d5f..bea4b6b 100644
--- a/_posts/2010-01-19-multiple-keys.markdown
+++ b/_posts/2010-01-19-multiple-keys.markdown
@@ -21,7 +21,19 @@ Configuring SSH
Once SSH has access to both keys, you need to tell it which key to use for which server. In most cases you can assume that SSH will fall back to `~/.ssh/id_rsa` by default, but we're going to force it anyway. To begin, open `~/.ssh/config` in your favorite editor.
-<script src="http://gist.github.com/281414.js?file=config"> </script>
+{% highlight bash %}
+# Default GitHub user (joe)
+Host github.com
+ HostName github.com
+ User git
+ IdentityFile /Users/joe/.ssh/id_rsa
+
+# Client user (client)
+Host github-client
+ HostName github.com
+ User git
+ IdentityFile /Users/joe/.ssh/id_rsa_client
+{% endhighlight %}
In short what this does is tells SSH to use the client key when connecting to the server github-client, which is really github.com.
diff --git a/_posts/2010-03-02-changing-author-info.markdown b/_posts/2010-03-02-changing-author-info.markdown
index 099aaf3..c567aef 100644
--- a/_posts/2010-03-02-changing-author-info.markdown
+++ b/_posts/2010-03-02-changing-author-info.markdown
@@ -9,8 +9,8 @@ If you need to modify the author info in your repo's history, you can do so with
__Big bold warning__ This action is destructive to your repo's history. It's best to do this on a clone, just in case. Also beware that this should not be performed on a repo that has been shared with others. Use at your own risk.
-<script src="http://gist.github.com/262686.js?file=history_rewrite.sh"> </script>
-<noscript><pre>#!/bin/sh
+{% highlight bash %}
+#!/bin/sh
git filter-branch --env-filter '
@@ -34,4 +34,5 @@ export GIT_AUTHOR_NAME="$an"
export GIT_AUTHOR_EMAIL="$am"
export GIT_COMMITTER_NAME="$cn"
export GIT_COMMITTER_EMAIL="$cm"
-'</pre></noscript> \ No newline at end of file
+'
+{% endhighlight %} \ No newline at end of file
diff --git a/css/style.css b/css/style.css
index f687165..e6adf31 100755
--- a/css/style.css
+++ b/css/style.css
@@ -53,18 +53,18 @@
/* Pre/code */
/**********************/
-.wikistyle pre {
+.wikistyle > pre {
padding: 1em !important;
background: #444 !important;
color: white !important;
font-size: 0.9em !important;
}
-.wikistyle pre span.comment {color: #aaa;}
+.wikistyle > pre span.comment {color: #aaa;}
code {white-space: nowrap;}
-.wikistyle pre code {
+.wikistyle > pre code {
white-space: pre;
background: none !important;
color: white !important;