Skip to content

Instantly share code, notes, and snippets.

View vergenzt's full-sized avatar

Tim Vergenz vergenzt

  • Jacksonville, FL
  • 20:26 (UTC -04:00)
View GitHub Profile
@btoone
btoone / curl.md
Last active June 29, 2024 16:01
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@afair
afair / tmux.cheat
Last active June 3, 2024 23:26
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
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 &
@henrik
henrik / _USAGE.md
Created September 1, 2012 18:56
Run some JS in Chrome from the command line and get the return value. Useful for scrapers that require JS and perhaps a session that's tricky to set up otherwise.

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"

When logged in.

@zhouji
zhouji / scp.gradle
Created February 22, 2013 09:47
SCP in gradle
// 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 {
@rufuspollock
rufuspollock / csv2sqlite.py
Last active April 14, 2016 14:22
UPDATED VERSION NOW AT https://github.com/rgrp/csv2sqlite [Script to load CSV to SQLite]
#!/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):
@stevenharman
stevenharman / defaults.rb
Last active July 7, 2021 14:36
A subtle difference between Ruby's Hash.fetch(:key, :default) vs. (Hash[:key] || :default)
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
@sethrylan
sethrylan / scalaConsole1
Last active June 17, 2016 20:08
ScalaBasePlugin scalaConsole/scalaTestConsole tasks
apply plugin: 'scala'
repositories {
mavenCentral()
}
ext {
versions = [
scala: '2.9.2',
scalatest: '2.0.M3',
@ssbarnea
ssbarnea / require-clean-work-tree
Last active July 18, 2022 16:28
require-clean-work-tree is a bash script that will prevent you from doing things if your working tree is dirty. It will detect your scm and return false if detection fails or the tree is dirty. Currently it supports only git and mercurial but we can add other scm later like svn or perforce.
#!/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
@natritmeyer
natritmeyer / debug_httparty_request.rb
Last active May 24, 2024 20:46
How to debug HTTParty requests
class MyResource
include HTTParty
debug_output $stdout # <= will spit out all request details to the console
#...
end
@dacort
dacort / cookiemonster.go
Created September 23, 2014 06:51
Simple script to extract (encrypted) cookies out of Chrome OS X cookie store. Usage: ./cookiemonster domain.com
package main
import (
"code.google.com/p/go.crypto/pbkdf2"
"crypto/aes"
"crypto/cipher"
"crypto/sha1"
"database/sql"
"fmt"
"log"