Sometimes, you’d like to look at delimited files on the command line:
cat test.csv
// ==UserScript== | |
// @name CPANSyntaxHighlight | |
// @namespace abiteasier.in | |
// @description Enable syntax highlighting when viewing the source on CPAN | |
// @include http://cpansearch.perl.org/src/* | |
// @version 0.9 | |
// @require http://yandex.st/highlightjs/7.3/highlight.min.js | |
// @resource syntaxHighlightCSS http://yandex.st/highlightjs/7.3/styles/github.min.css | |
// @grant GM_addStyle | |
// @grant GM_getResourceText |
command_strings = { | |
'php artisan make="hi mate" heh "I have a value"', | |
"php artisan make:auth", | |
[[I "am" 'the text' and "some more text with '" and "escaped \" text"]], | |
[[1 2 word 2 9 'more words' 1 "and more" "1 2 34"]], | |
[[omo "This is a string!" size=14 font="Comic Sans" break= hmm "thing and 'thing'" ]] | |
} | |
function command_parse(s) | |
local t={} |
-- get Dock height | |
tell application "System Events" to tell process "Dock" | |
set dock_dimensions to size in list 1 | |
set dock_height to item 2 of dock_dimensions | |
end tell | |
-- get the new width and height for the window | |
tell application "Finder" | |
set desktop_dimensions to bounds of window of desktop | |
set new_width to (item 3 of desktop_dimensions) / 2 | |
set new_height to (item 4 of desktop_dimensions) - dock_height |
(* Launches Google Chrome with web security disabled. | |
This disables the same origin policy for API calls and can | |
ease development from a dev environment not in a server's CORS settings *) | |
(* This same command can be sent to Canary by changing | |
'Google Chrome.app' to 'Google Chrome Canary.app' *) | |
do shell script "open -a 'Google Chrome.app' --args --disable-web-security --allow-running-insecure-content" | |
(* If you want to not use your current user in Chrome you can set --user-data-dir to point to /tmp |
-- duplicateFinderTab.scpt | |
-- Uses a hacky workaroud to duplicate the frontmost Finder tab, | |
-- since Apple hasn't provided great AppleScript support for this. | |
-- Details at: | |
on new_tab() | |
tell application "System Events" to tell application process "Finder" | |
set frontmost to true | |
tell front menu bar to tell menu "File" to tell menu item "New Tab" | |
perform action "AXPress" |
cd "$(osascript -e 'tell application "Finder" to get the POSIX path of (target of front window as alias)')" && | |
git status --short --branch |
#!/usr/local/bin/node | |
var Table = require('cli-table'); | |
var table = new Table({ | |
chars: { 'top': '' , 'top-mid': '' , 'top-left': '' , 'top-right': '' | |
, 'bottom': '' , 'bottom-mid': '' , 'bottom-left': '' , 'bottom-right': '' | |
, 'left': '' , 'left-mid': '' , 'mid': '' , 'mid-mid': '' | |
, 'right': '' , 'right-mid': '' , 'middle': ' ' }, | |
style: { 'padding-left': 0, 'padding-right': 0 } |
javascript: /* Video salvager bookmarklet */ | |
/* | |
Usage: Run this bookmarklet when viewing a list of a playlist. | |
The link should be something like https://www.youtube.com/playlist?list=[BUNCH_OF_LETTERS_AND_NUMBERS] | |
Why use this: There have been too many times that I've lost the title of an important | |
YouTube video from a playlist of mine and have no idea what the video title was called. | |
Unfortunately, this no longer works for certain playlists (for example, Watch Later) as | |
YouTube will automatically remove them from the playlist if a video within it was deleted. |
function find_roku { | |
for i in $(arp -a | awk '{print $2}' | sed "s/[(|)]//g"); do | |
curl $i:8060 &>/dev/null | |
if [[ "$?" == "0" ]]; then | |
echo $i | |
export ROKU_IP=$i | |
fi | |
done | |
} |