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
function clone(value, deep) { | |
var boo = '[object Boolean]'; | |
var num = '[object Number]'; | |
var str = '[object String]'; | |
var obj = '[object Object]'; | |
var arr = '[object Array]'; | |
var date = '[object Date]'; | |
var reg = '[object RegExp]'; | |
var cloned; | |
var klass; |
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
function extend() { | |
var args = [].slice.call(arguments); | |
args[0] = (typeof args[0] === 'object') ? args[0] : {}; | |
for (var i=1; i<args.length; i++) { | |
if (typeof args[i] === 'object') { | |
for (var key in args[i]) { | |
if (args[i].hasOwnProperty(key)) { | |
args[0][key] = args[i][key]; | |
} | |
} |
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
tell application "OmniFocus" to activate | |
tell application "System Events" | |
tell process "OmniFocus" | |
set perspectivesMenu to the first menu bar item of item 1 of menu bars whose name contains "Perspectives" | |
set inboxMenuItem to the first menu item of the first menu of perspectivesMenu whose name is "Inbox" | |
set viewMenu to the first menu bar item of item 1 of menu bars whose name contains "View" | |
click inboxMenuItem | |
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
tell application "System Events" to tell process "Dock" | |
set dock_dimensions to size in list 1 | |
set dock_width to item 1 of dock_dimensions | |
set dock_height to item 2 of dock_dimensions | |
end tell |
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
heroku pg:backups capture | |
# replace BACKUP_NUM with backup number from above | |
heroku pg:backups public-url BACKUP_NUM | |
# replace URL with step from above | |
curl -o latest.dump URL | |
# replace LOCAL_DB_NAME with local database table | |
# replace DB_USERNAME with db user |
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
require 'rack' | |
require 'json' | |
COUNTERS = {} | |
app = Proc.new do |env| | |
req = Rack::Request.new(env) | |
COUNTERS[req.path] ||= 0 |
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
class ApiClient | |
attr_accessor :api_key | |
def initialize(api_key: nil) | |
@api_key = api_key | |
end | |
def some_method | |
path = "/some_path" | |
get_json!(path) |
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
// ==UserScript== | |
// @name JIRA Header color | |
// @namespace https://stevenschobert.com/ | |
// @version 0.1 | |
// @description Changes header color for JIRA. | |
// @author Steven Schobert | |
// @match https://ovenbits.atlassian.net/* | |
// @grant GM_addStyle | |
// ==/UserScript== |
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
class ApiClient | |
attr_accessor :base_url | |
attr_accessor :default_headers | |
attr_accessor :default_params | |
attr_accessor :basic_auth | |
attr_reader :body | |
def initialize(base_url:, headers: {}, params: {}) | |
@base_url = base_url |