An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
# Usage: | |
# | |
# Rails | |
# Step 1: write a gist with a file named __script__.rb | |
# Step 2: copy and paste the function def below into Rails console | |
# Step 3: run `eval_gist("the-gist-id-from-the-url")` | |
# Step 4: GOTO Step 3 | |
# | |
# Ruby | |
# Start an IRB session and load this file |
puts "[#{Time.now}] Hello from GitHub!" |
Regex to match parts of a domain | |
http://stackoverflow.com/questions/4636497/regular-expression-match-domain-in-uri | |
^[^\/]+:\/\/[^\/]*?\.?([^\/.]+)\.[^\/.]+(?::\d+)?\/ | |
http://www.rubular.com/r/Uv5ON7eAz4 | |
^ # Match the beginning of the string | |
[^\/]+:\/\/ # Match the protocol (e.g. http://) | |
[^\/]*? # Non-greedy match of the sub-domains | |
\.? # Optional . (for when a sub-domain is used) |
# app/config/deploy.rb | |
# Most of the changes specific to your environment will be set in | |
# the `app/config/deploy/[env].rb` files. | |
# define multiple deployments | |
set :stages, %w(production staging) | |
set :default_stage, "staging" |
# Basic commands | |
:Git [args] # does what you'd expect | |
all of your `~/.gitconfig` aliases are available. | |
:Git! [args] # same as before, dumping output to a tmp file | |
Moving inside a repo. |
sed -i '/pattern/d' file |
sed -i.bak 's/pattern1/pattern2/g' file |
" Set leader to be spacebar | |
let mapleader=" " | |
set hlsearch | |
set incsearch | |
set laststatus=2 | |
set ruler | |
set history=100 | |
set autoindent | |
set backspace=indent,eol,start |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>AngularJS Routing example</title> | |
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"> | |
<style> | |
body { | |
padding-top: 10px; | |
background-color: #F5F5F5; | |
} |