Skip to content

Instantly share code, notes, and snippets.

View rsvp's full-sized avatar
🎧
say hi ! https://gitter.im/rsvp/pub

Adriano rsvp

🎧
say hi ! https://gitter.im/rsvp/pub
View GitHub Profile
@rsvp
rsvp / soundcloud-mp3.js
Created March 9, 2012 02:54 — forked from pheuter/sc-dl.js
SoundCloud bookmarklet that generates link to download MP3
/**
2012-03-26 Forked from duncanbeevers' sc-dl.js : https://gist.github.com/2157987
**/
(function(document) {
var link = document.createElement("a"),
span = document.createElement("span"),
slug = document.querySelector("#main-content-inner img[class=waveform]").src.match(/\.com\/(.+)\_/)[1],
mp3 = document.querySelector("em").innerText + ".mp3";
@rsvp
rsvp / keywords.sh
Created March 25, 2012 02:33
keywords.sh : extract keywords from text. Useful with freqy.sh for summarization.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-03-13
#
# _______________| keywords : extract keywords from text.
#
# Usage: keywords [file, -x, -] [postproduction]
# # clipboard^ ^stdin (default)
#
# Example: % keywords foo.txt cat
# # or try something like...
@rsvp
rsvp / colline.sh
Created March 25, 2012 02:45
colline.sh : convert column to line with optional delimiter string.
#!/usr/bin/env bash
# bash 3.2.25(1) Ubuntu 7.10 Date : 2012-03-25
#
# _______________| colline : convert column to line with optional delimiter.
#
# Usage: colline [file] [delimiter]
# ^space as default; string is acceptable.
# ^assuming each line represents one column.
#
# Dependencies: awk, sed
@rsvp
rsvp / quotel.sh
Created March 25, 2012 02:58
quotel.sh : quote lines using prefix and suffix strings. By default, those are double quotes.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-03-23
#
# _______________| quotel : quote lines using prefix and suffix strings.
#
# Usage: quotel [filename] [prefix string] [suffix string]
# # stdin and double quotes are defaults.
# # Use '~' to represent an empty string.
#
# Dependencies: sed
@rsvp
rsvp / argin.sh
Created March 25, 2012 03:14
argin.sh : universal xargs properly handled from ANY standard input. Plus parallelization is activated by default. (No more hassles with the null character :-) argin.sh converts lines from stdin into arguments to build and execute a command individually.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-03-22
#
# _______________| argin : xargs properly handled from ANY standard input.
# xargs converts stdin into arguments in order
# to build and execute a command individually.
#
# Usage: argin [options] command [{} as placeholder if necessary]
#
# Examples: % argin -t echo {} < foo.txt 2> argin-done.txt
@rsvp
rsvp / locat.sh
Created March 25, 2012 19:48
locat.sh : locate files much more quickly and precisely than find -- with glob and colored extended regex.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-03-20
#
# _______________| locat : find files with glob and colored extended regex.
#
# Usage: locat [extended regex] [glob pattern]
#
# Examples: % locat pdf$
# # pdf files stemmed under present working directory,
# # ^so seemingly recursive.
@rsvp
rsvp / linecol.sh
Created April 1, 2012 23:49
lincol.sh : convert regex delimited lines into single column. E.g. linecol foo.csv ', *' #-- so each item on a CSV line will be on its own line.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-04-06
#
# _______________| linecol : convert regex delimited lines into single column.
#
# Usage: linecol [filename] [delimiter regex]
#
# Examples: % linecol foo.csv ', *'
# # ^use single quotes for regex.
# # Each item on a CSV line will be on its own line.
@rsvp
rsvp / sto.sh
Created April 23, 2012 00:28
sto.sh : interim temporary storage with tee, pager, format, diff. Fast quintessential command-line management between three storage units. Linux bash script.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-04-10
#
# _______________| sto : interim tmp storage with tee, pager, format, diff.
# There are THREE storage units.
#
# Usage: sto [ input: i, j, k output: oi, oj, ok diff: d??
# append: I, J, K xclip: x, y, z shift: s
# format: f, g, h addclip: X, Y, Z accumulate: a
# copy: ci, cj, ck [new prefix] cat: c
@rsvp
rsvp / jason.sh
Created June 17, 2012 03:26
jason.sh : pretty print json for key-value processing line-by-line. The goal is a readable and grepable output.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-06-16
#
# _______________| jason : pretty print json for key-value processing by line.
#
# Usage: jason [file] [ident=5] [delim='__:']
#
# Examples: % jason foo.json 0 ': '
# # ^typical json key-value separator.
# # ^ident of 0 for just newline.
@rsvp
rsvp / tagscrape.sh
Created July 12, 2012 05:12
tagscrape.sh : scrape content between given html tag. | Linux bash script.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-07-11
#
# _______________| tagscrape : echo content(s) between html tag pair.
#
# Usage: tagscrape [tag] [file/URL]
# # Output will exclude the tag themselves.
# # Default for file is stdin, so pipe will work.
#
# Examples: % tagscrape pre foo.html