This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to find what flags were passed to configure when compiling mysql | |
mysqlbug | |
# scroll to bottom of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cycle all npm packages | |
npm ls installed | ack -o '^(?!npm)[\w-]+' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set myHeight to 600 | |
set myWidth to 800 | |
tell application "Fake" | |
set theWindow to window 1 | |
-- bounding rect is { left, top, right, bottom }. The index is one-based. | |
-- Note: this is the size of the window. The actual viewport size will be smaller. | |
set theBounds to the bounds of theWindow | |
set (item 3 of theBounds) to ((item 1 of theBounds) + myWidth) | |
set (item 4 of theBounds) to ((item 2 of theBounds) + myHeight) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -w | |
require 'fileutils' | |
module Git | |
class Setting | |
attr_reader :key | |
attr_reader :value | |
attr_reader :text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: safe_mv dir1/file.txt dir2 | |
# If dir2 contains "file.txt", the moved file will be renamed to "file1.txt" | |
function safe_mv() { | |
FULL_PATH=$1 | |
FILE_NAME=$(basename $FULL_PATH) | |
FILE_NAME_WITHOUT_EXT=${FILE_NAME%.*} | |
EXT=${FILE_NAME#*.} | |
# Trim any trailing slashes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Text color variables | |
txtund=$(tput sgr 0 1) # Underline | |
txtbld=$(tput bold) # Bold | |
txtred=$(tput setaf 1) # Red | |
txtgrn=$(tput setaf 2) # Green | |
txtylw=$(tput setaf 3) # Yellow | |
txtblu=$(tput setaf 4) # Blue | |
txtpur=$(tput setaf 5) # Purple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From http://hints.macworld.com/article.php?story=20120326061614691 | |
defaults write com.apple.Dock autohide-delay -float 0 && killall Dock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/node | |
// ThisService node.js service script example, by Christian Eager | |
// Service type: Acts on input | |
// | |
// Node.js does *not* ship with OS X | |
// Download and installation instructions are available at http://nodejs.org | |
process.stdin.resume() | |
// Makes the data event emit a string instead of a Buffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/node | |
// Unfortunately, /usr/bin/env node doesn’t work if node is in /usr/local/bin | |
var spawn = require('child_process').spawn, | |
textutil = spawn('textutil', ['-stdin', '-stdout', '-format', 'html', '-convert', 'rtf']) | |
pbcopy = spawn('pbcopy') | |
textutil.stdout.pipe(pbcopy.stdin) | |
process.stdin.resume() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bundle Scope: Data Table | |
# Menu Label: Copy as GFM | |
# Menu Category: Copy | |
# Input: Selected Rows (TSV) AND exclude BLOB | |
# Tooltip: Copies the selected rows excluding any BLOB data GitHub-Flavored-Markdown table-formatted into the pasteboard | |
cat | perl -e ' | |
# read first line to get the column names (header) | |
$firstLine = <>; |
OlderNewer