Skip to content

Instantly share code, notes, and snippets.

@thomaswhitcomb
thomaswhitcomb / gist:7937271
Created December 12, 2013 23:15
Functional play time
package main
import "fmt"
type II interface{}
func mapper (collection [] II,fn func(II) II) [] II {
mapped := make([] II,0)
for _,v := range(collection){
mapped = append(mapped,fn(v))
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@raedatoui
raedatoui / gist:2597831
Created May 4, 2012 21:26
Swagger nested resources
//resources.json
{
"apiVersion": "0.1",
"apis": [
{
"description": "Operations about projects",
"path": "/project.{format}"
},
{
"description": "Operations about tickets",
@ashee
ashee / aws-bash.sh
Created March 14, 2012 17:28
Bash script to make AWS REST calls
#!/bin/bash
KEY='<get from AWS>'
ASSOC_ID='<get from AWS>'
TS=$(date -u "+%Y-%m-%dT%H:%M:%SZ" | sed 's/:/%3A/g')
RPARMS="AWSAccessKeyId=$KEY&AssociateTag=$ASSOC_ID&ItemId=0679722769&Operation=ItemLookup&ResponseGroup=ItemAttributes%2COffers%2CImages%2CReviews&Service=AWSECommerceService&Timestamp=$TS&Version=2009-01-06"
read -r -d '' REQ <<EOF
GET
@chrisroos
chrisroos / gpg-import-and-export-instructions.md
Created September 9, 2011 10:49
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...