An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
# Make sense of puppet circular dependency error messages. | |
# Tags: graphviz, puppet | |
# See output at http://i41.tinypic.com/b6yeqv.jpg | |
$ cat circular.pp | |
node default { | |
exec { "/a": require => Exec["/b"] } | |
exec { "/b": require => Exec["/c"] } | |
exec { "/c": require => Exec["/a"] } | |
} |
#!/usr/bin/env ruby -w | |
## Using ruby's standard OptionParser to get subcommand's in command line arguments | |
## Note you cannot do: opt.rb help command | |
## other options are commander, main, GLI, trollop... | |
# run it as | |
# ruby opt.rb --help | |
# ruby opt.rb foo --help | |
# ruby opt.rb foo -q | |
# etc |
/* Temporary disable $stdout | |
============================ | |
This method works for Ruby and new sub-processes. | |
I have seen other techniques on the net which re-assign $stdout with another IO, | |
but then the sub-processes will still use the old stdout. | |
*/ |
" http://vimdoc.sourceforge.net/htmldoc/starting.html#vimrc | |
set nocompatible " use vim defaults | |
set scrolloff=3 " keep 3 lines when scrolling | |
set ai " set auto-indenting on for programming | |
set showcmd " display incomplete commands | |
set nobackup " do not keep a backup file | |
set number " show line numbers | |
set ruler " show the current row and column |
redirect: 34f08d5e11952a80609169b7917d4172 |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
# stacktrace java as one message | |
multiline { | |
#type => "all" # no type means for all inputs | |
pattern => "(^.+Exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*Caused by:.+)" | |
what => "previous" | |
} | |
# Raw transaction API example work-through | |
# Send coins to a 2-of-3 multisig, then spend them. | |
# | |
# For this example, I'm using these three keypairs (public/private) | |
# 0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86 / 5JaTXbAUmfPYZFRwrYaALK48fN6sFJp4rHqq2QSXs8ucfpE4yQU | |
# 04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8722084861c5c3291ccffef4ec6874 / 5Jb7fCeh1Wtm4yBBg3q3XbT6B525i17kVhy3vMC9AqfR6FH2qGk | |
# 048d2455d2403e08708fc1f556002f1b6cd83f992d085097f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46213 / 5JFjmGo5Fww9p8gvx48qBYDJNAzR9pmH5S389axMtDyPT8ddqmw | |
# First: combine the three keys into a multisig address: | |
./bitcoind createmultisig 2 '["0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86","04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a9 |
#!/usr/bin/env ruby | |
require 'pp' | |
require 'uri' | |
require 'net/http' | |
require 'octokit' | |
require 'nokogiri' | |
require 'celluloid' | |
require 'mongo' | |
require 'logger' |
When hosting a project on GitHub, it's likely you'll want to use GitHub Pages to host a public web site with examples, instructions, etc. If you're not using a continuous integration service like Travis, keeping your gh-pages site up to date requires continuous wrangling.
The steps below outline how to use Travis CI with GitHub Releases and GitHub Pages to create a "1-button" deployment workflow. After testing and running a release build, Travis will upload your release assets to GitHub. It will also push a new version of your public facing site to GitHub Pages.
Let's assume you are hosting a JavaScript project that will offer a single JavaScript file as a release asset. It's likely you'll organize your files like this.