Skip to content

Instantly share code, notes, and snippets.

@execjosh
execjosh / install-tools
Last active January 23, 2022 08:22
A better way to install Go tool dependencies
#!/bin/bash
# Assuming ./tools/tools.go, the following will give you a list of your tools:
#
# go list -f '{{ join .Imports "\n" }}' -tags tools ./tools
#
# No need for the likes of grep, awk, sed, cut, etc.
while read -r i; do
echo "## go install ${i}"
package main
import (
"fmt"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
)
@peterprokop
peterprokop / URLRequest.swift
Last active August 29, 2022 15:40
Print NSURLRequest in cURL format (Swift 3)
//
// URLRequest.swift
//
// Created by Peter Prokop on 17/08/2017.
import Foundation
public extension URLRequest {
/// Returns a cURL command for a request
@JunichiIto
JunichiIto / alias_matchers.md
Last active April 16, 2024 16:18
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@udzura
udzura / tutorial.md
Created June 2, 2014 03:31
Hubot + CoffeeScript ではじめるやわらかプログラミング入門

やわらかプログラミング入門

  • Hubot であそぼう


始めに、地図を描く

@hlung
hlung / How to connect a PS3 controller.md
Last active March 25, 2024 14:45
How to connect PS3 controller on Mac OSX, PC

How to connect PS3 controller on Mac OSX, PC, etc.

This is how you connect PS3 controller to Mac OSX, PC, etc. when previously connected to a PS3. You will need a Mini USB cable. Overcome your laziness, get up of your chair, and go get one!

A big misconception is that keep holding PS button will reset the controller's pairing. It DOES NOT! From my testings, the controller keeps paring with the last machine it was CONNECTED VIA A USB CABLE.

Here are the steps:

@endolith
endolith / export_google_starred_locations.py
Created October 16, 2012 02:29
Export Google Maps starred locations
# -*- coding: utf-8 -*-
"""
Go to Google Bookmarks: https://www.google.com/bookmarks/
On the bottom left, click "Export bookmarks": https://www.google.com/bookmarks/bookmarks.html?hl=en
After downloading the html file, run this script on it to generate a KML.
"""
@ku
ku / gopen
Created February 17, 2012 22:23
open corresponding URL of the repository of current directory
#!/bin/sh
GIT='git'
if test `uname` = "Darwin" ; then
SED_OPT='-E'
OPEN='open'
else
SED_OPT='-r'
OPEN=''
models.register({
name : 'ReadItLater',
ICON : 'http://readitlaterlist.com/favicon.ico',
LINK : 'http://readitlaterlist.com/',
LOGIN_URL : 'http://readitlaterlist.com/l',
check : function(ps){
return /quote|link/.test(ps.type);
},
post : function(ps){
var that = this;