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
// New plugin file: | |
import sublime, sublime_plugin | |
class ScopeToClipboardCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
sublime.set_clipboard(self.view.syntax_name(self.view.sel()[0].b)) | |
// Set key binding: | |
{ "keys": ["shift+alt+command+p"], "command": "scope_to_clipboard" } |
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 | |
# | |
# Script to send email notification if a server exceeds a specified load average. | |
# | |
# Selected load average limit. If above this number a notification message will be emailed. | |
NOTIFY="8" | |
TRUE="1" | |
# Email address to receive alerts. |
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
Show hidden characters
{ | |
"browser": true, | |
"devel": true, | |
"jquery": true, | |
"undef": true, | |
"unused": true | |
} |
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
{ | |
"user": { | |
"debug": false, | |
"delay": 0.25, | |
"error_color": "D02000", | |
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme", | |
"gutter_theme_excludes": [], | |
"lint_mode": "background", | |
"linters": { | |
"csslint": { |
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
_dirComplete() | |
{ | |
local cur=${COMP_WORDS[COMP_CWORD]} | |
COMPREPLY=( $(compgen -W "$(ls ~/public_html/dev/)" -- $cur) ) | |
} | |
complete -F _dirComplete cddev | |
cdDev() { | |
cd ~/public_html/dev/$1 |
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
<?php | |
/** | |
* Enqueue ga.js and pass PHP variables into it | |
*/ | |
function ga_script_enqueuer() { | |
wp_enqueue_script('ga', get_template_directory_uri() . 'ga.js'); |
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
{ | |
// JSHint Default Configuration File (as on JSHint website) | |
// See http://jshint.com/docs/ for more details | |
"maxerr" : 50, // {int} Maximum error before stopping | |
// Enforcing | |
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) | |
"camelcase" : false, // true: Identifiers must be in camelCase | |
"curly" : true, // true: Require {} for every new block or scope |
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
<?php | |
/** | |
* Change the default GF upload path | |
* https://www.gravityhelp.com/documentation/article/gform_upload_path/ | |
*/ | |
function agw_change_upload_path($path_info, $form_id){ | |
$wp_upload_path = wp_upload_dir(); | |
$path_info["path"] = $wp_upload_path['path'] . '/'; | |
$path_info["url"] = $wp_upload_path['url'] . '/'; |
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 | |
require "json"; | |
# Change github credentials and organization name | |
github = {:user => "johndoe", :pass => "password", :org => "twitter"} | |
repos = `curl --user "#{github[:user]}:#{github[:pass]}" https://api.github.com/orgs/#{github[:org]}/repos\?per_page\=200\&type\=private` | |
for repo in JSON.load(repos) | |
puts "\n+++ Starting with " + repo["name"] | |
%x[git clone #{repo["ssh_url"]}] |
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
# This is a general-purpose function to ask Yes/No questions in Bash, either | |
# with or without a default answer. It keeps repeating the question until it | |
# gets a valid answer. | |
ask() { | |
# http://djm.me/ask | |
while true; do | |
if [ "${2:-}" = "Y" ]; then | |
prompt="Y/n" |
OlderNewer