This file contains hidden or 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 enableFunctionKeys(functionKeys) | |
tell application "System Preferences" to activate | |
tell application "System Preferences" | |
activate | |
reveal pane id "com.apple.preference.keyboard" | |
tell application "System Events" | |
tell application "System Preferences" | |
reveal anchor "keyboardTab" of pane "com.apple.preference.keyboard" | |
end tell | |
tell checkbox 1 of tab group 1 of window 1 of application process "System Preferences" |
This file contains hidden or 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
# Local configuration | |
/.docker.env | |
/.env | |
/.haml-lint.yml | |
/.yardoc | |
/coffeelint.json | |
/config/database.yml | |
/config/master.key | |
/config/secrets.yml.key | |
/config/settings.local.yml |
This file contains hidden or 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
SELECT blocked_locks.pid AS blocked_pid, | |
blocked_activity.usename AS blocked_user, | |
blocking_locks.pid AS blocking_pid, | |
blocking_activity.usename AS blocking_user, | |
blocked_activity.query AS blocked_statement, | |
blocking_activity.query AS blocking_statement, | |
blocking_activity.query_start AS blocking_start | |
FROM pg_catalog.pg_locks blocked_locks | |
JOIN pg_catalog.pg_stat_activity blocked_activity ON blocked_activity.pid = blocked_locks.pid | |
JOIN pg_catalog.pg_locks blocking_locks |
This file contains hidden or 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
-- display how long query takes | |
\timing | |
-- how to show NULLs | |
\pset null null | |
-- disable page | |
\pset pager off | |
-- automatic extended output based on the width of the table |
This file contains hidden or 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
script = document.createElement('script'); | |
script.src = 'http://code.jquery.com/jquery-2.1.3.min.js'; | |
document.head.appendChild(script); | |
window.photoLinks = []; | |
function printLinks() { | |
$.each($.unique(window.photoLinks), function(i, link) { | |
console.log(link); | |
}); |
This file contains hidden or 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
(* | |
# DESCRIPTION # | |
Based on: http://bylr.net/3/2015/05/omnifocus-view-project-in-new-window/ | |
Flags or unflags project of selected action. | |
# LICENSE # | |
Copyright © 2015 Dan Byler (contact: [email protected]) |
This file contains hidden or 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 | |
# Quick and dirty Slack channel links counter. Counts the number of occurrences of links to most popular domains. | |
require 'slack' # gem install slack-api | |
TOKEN = ENV['TOKEN'] | |
CHANNEL_NAME = 'general' | |
client = Slack::Client.new token: TOKEN | |
channel_detector = proc { |channel| channel['name'] == CHANNEL_NAME } |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.exclude-code-subdirectories-from-backups</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>sh</string> | |
<string>-c</string> |
This file contains hidden or 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 | |
require 'fileutils' | |
SOURCE_DIRECTORY = File.expand_path raise 'Path to source directory is not set' | |
Dir.chdir SOURCE_DIRECTORY | |
TARGET_NAME = raise 'Target name is not set' | |
ARCHIVE_NAME = "#{TARGET_NAME}.zip" | |
TARGET_DIRECTORY = File.expand_path "../#{TARGET_NAME}" | |
ARCHIVE_TAGET_DIRECTORY = raise 'Archive target directory is not set' |
This file contains hidden or 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 -l | |
# tmux shell for macOS Terminal application | |
# | |
# Starts tmux taking current directory and open tmux sessions into account | |
# | |
# When Terminal starts, it's $PWD always equals $HOME. Except cases when Terminal application was told to open | |
# some particular directory (`open ~/Code -a Terminal` for instance). | |
# | |
# In the first case we want to attach to existing tmux session if one exists. If there is more than one | |
# session open, the script will ask user which session to attach to. |
OlderNewer