most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat| /* | |
| * ctrl-f1 | |
| * ------- | |
| * Query or toggle the "Full Keyboard Access" hotkey, Ctrl-F1 | |
| * | |
| * make CC=clang CFLAGS="-framework Carbon" ctrl-f1 | |
| */ | |
| #include <Carbon/Carbon.h> |
| /** | |
| * POST data from a Google Spreadsheet to a remote URL, via menu option Add-ons > Post values | |
| * See: http://www.google.com/google-d-s/scripts/guide.html for more info | |
| */ | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var sheet = ss.getSheets()[0]; | |
| var r = sheet.getRange("B5"); | |
| function onOpen() { |
| // ==UserScript== | |
| // @name Torrentz Direct Link | |
| // @description Adds direct links to torrent pages, you won't have to go to the original index. | |
| // @author Koen Bollen | |
| // @match http://torrentz.com/* | |
| // ==/UserScript== | |
| var rxs = { | |
| 'piratebay.org': [ |
| #!/bin/bash | |
| # | |
| # bash script to create playlist files in music subdirectories | |
| # | |
| # Steve Carlson ([email protected]) | |
| find . -type d | | |
| while read subdir | |
| do | |
| rm -f "$subdir"/*.m3u |
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
| <title>SpreadEmbed</title> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> | |
| <script type="text/javascript" src="http://www.google.com/jsapi"></script> | |
| <script type="text/javascript" src="jquery.embedly.min.js"></script> | |
| <script type="text/javascript"> | |
| google.load('visualization', '1'); |
| color_classes = ['green','purple','violet','teal','pink']; | |
| (function() { | |
| const initLinks = function() { | |
| const div = document.querySelector('#mydiv'); | |
| console.log(div) | |
| div.addEventListener('mouseover',function(){ | |
| color_classes.forEach(color =>{ | |
| div.classList.remove(color); | |
| }); | |
| div.classList.add(randomFrom(color_classes)); |
To see what shell you are using, you can:
echo $SHELL
and it will tell you.
Use the below only if you are using bash.
Run the following to create ~/.git-completion.bash:
curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash > ~/.git-completion.bash
| // The rest of this code is currently (c) Google Inc. | |
| // setRowsData fills in one row of data per object defined in the objects Array. | |
| // For every Column, it checks if data objects define a value for it. | |
| // Arguments: | |
| // - sheet: the Sheet Object where the data will be written | |
| // - objects: an Array of Objects, each of which contains data for a row | |
| // - optHeadersRange: a Range of cells where the column headers are defined. This | |
| // defaults to the entire first row in sheet. | |
| // - optFirstDataRowIndex: index of the first row where data should be written. This |
| #!/usr/bin/env ruby | |
| # Uses the Readability Metrics API from http://ipeirotis.appspot.com/readability-api.html | |
| # Accepts text from STDIN (piped) or as an argument | |
| =begin examples | |
| pbpaste|text_score.rb # copy text and run (on OS X) to get the stats for the clipboard. | |
| cat myfile.md|text_score.rb # get scores for the contents of a file | |
| =end | |
| require 'open-uri' | |
| require 'net/http' |