Skip to content

Instantly share code, notes, and snippets.

View itsbrex's full-sized avatar
🎯
focusing

Brian Roach itsbrex

🎯
focusing
View GitHub Profile
/*
* 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() {
@koenbollen
koenbollen / torrentz.user.js
Created October 31, 2010 18:38
A Chrome Userscript that adds direct-download-links to torrent pages of http://torrentz.com/.
// ==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': [
@scarlson
scarlson / playlist.sh
Last active February 22, 2024 01:31
Bash script to create .m3u playlist files for all mp3s in subdirectories
#!/bin/bash
#
# bash script to create playlist files in music subdirectories
#
# Steve Carlson (stevengcarlson@gmail.com)
find . -type d |
while read subdir
do
rm -f "$subdir"/*.m3u
@mhawksey
mhawksey / index.html
Created October 12, 2011 16:56
SpreadEmbed - Simple site to convert Google Spreadsheet column of links into objects using embed.ly
<!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');
@saetia
saetia / gist:1623487
Last active May 1, 2024 19:55
Clean Install – OS X 10.11 El Capitan

OS X Preferences


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
@tw2113
tw2113 / gist:1804843
Last active January 13, 2024 02:10
Random color on hover
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));
@ivanoats
ivanoats / gist:1823034
Last active November 19, 2022 06:08 — forked from parndt/gist:958385
Setting up GIT Bash autocompletion. Use this only if you are using Bash instead of ZSH.
@labnol
labnol / gist:1907321
Created February 25, 2012 08:19 — forked from mhawksey/gist:1723943
Core Google Apps Script Functions
// 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
@ttscoff
ttscoff / text_score.rb
Created June 17, 2012 16:17
Readability stats for passed text using ipeirotis.appspot.com
#!/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'