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
========================================== ========================================== | |
TMUX COMMAND WINDOW (TAB) | |
========================================== ========================================== | |
List tmux ls List ^b w | |
New new -s <session> Create ^b c | |
Attach att -t <session> Rename ^b , <name> | |
Rename rename-session -t <old> <new> Last ^b l (lower-L) | |
Kill kill-session -t <session> Close ^b & |
This AppleScript opens a page in Chrome (where you presumably have a logged-in session if required), opens the passed-in URL, runs the passed-in JavaScript and returns the JS return value.
Waits for 1 second for the page to load before executing the JS. Optionally, pass in a third argument with the number of seconds to wait.
Examples:
osascript js_in_chrome.scpt "http://google.com" "document.title"
// File: build.gradle | |
// We define a new configuration with the name 'sshAntTask'. | |
// This configuration is used to define our dependencies. | |
configurations { | |
sshAntTask | |
} | |
// Define the Maven central repository to look for the dependencies. | |
repositories { |
#!/usr/bin/env python | |
# A simple Python script to convert csv files to sqlite (with type guessing) | |
# | |
# @author: Rufus Pollock | |
# Placed in the Public Domain | |
import csv | |
import sqlite3 | |
def convert(filepath_or_fileobj, dbpath, table='data'): | |
if isinstance(filepath_or_fileobj, basestring): |
h = { | |
'a' => :a_value, | |
'b' => nil, | |
'c' => false | |
} | |
h.fetch('a', :default_value) #=> :a_value | |
h.fetch('b', :default_value) #=> nil | |
h.fetch('c', :default_value) #=> false | |
h.fetch('d', :default_value) #=> :default_value |
apply plugin: 'scala' | |
repositories { | |
mavenCentral() | |
} | |
ext { | |
versions = [ | |
scala: '2.9.2', | |
scalatest: '2.0.M3', |
#!/bin/bash | |
# version: 1.0 | |
# author: Sorin Sbarnea | |
require_clean_work_tree_git () { | |
git rev-parse --verify HEAD >/dev/null || exit 1 | |
git update-index -q --ignore-submodules --refresh | |
err=0 | |
if ! git diff-files --quiet --ignore-submodules |
class MyResource | |
include HTTParty | |
debug_output $stdout # <= will spit out all request details to the console | |
#... | |
end |