git checkout master
git pull
git checkout -b feature/my-work
# edit your files
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 | |
# Pre-commit hook for git which removes trailing whitespace, converts tabs to spaces, and enforces a max line length. | |
if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
fi |
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
// Custom Helper function for ExtendScript (Adobe CEP) created as an alternative since JavaScript Object(keys) method does not work | |
var getKeysWithoutObjectKeysSupport = function(associativeArrayObject) { | |
var arrayWithKeys=[], associativeArrayObject; | |
for (key in associativeArrayObject) { | |
// Avoid returning these keys from the Associative Array that are stored in it for some reason | |
if (key !== undefined && key !== "toJSONString" && key !== "parseJSON" ) { | |
arrayWithKeys.push(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
# copy, paste, and execute this code in a python repl with python v2.7.12 or greater installed | |
import sys; assert sys.version_info >= (2,7,12) | |
# reimplement default repr function to return a module, name, and memory address of given object | |
def __repr__(self): | |
return '<%s.%s object at %s>' % ( | |
self.__class__.__module__, | |
self.__class__.__name__, | |
hex(id(self)) | |
) |
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
# Note: Some Python interpreters may prevent setting the severity level to certain levels below a threshold | |
import logging | |
logger = logging.getLogger('sudoku logger') | |
logger | |
def run_logger_calls(): | |
logger.debug('debug message') | |
logger.info('info message') | |
logger.warning('warn message') | |
logger.error('error message') |
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
values = {} | |
assert type(values) is not object, "values is not an None: %r" % values | |
assert type(values) is bool, "values is not a Boolean: %r" % values |
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 python | |
import sys | |
import logging | |
import logging.config # import associated logging.conf. Refer to https://docs.python.org/3/howto/logging.html | |
import solution # import a file called say solution.py | |
def get_log_level(log_args): | |
valid_levels = ['DEBUG', 'INFO', 'WARNING', 'ERROR'] # numeric levels 10, 20, 30, 40 | |
proposed_level = log_args[0].split("=", 1)[1].upper() |
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/bash | |
# File: ~/launch.sh | |
# Original Code Reference: http://dan.doezema.com/2013/04/programmatically-create-title-tabs-within-the-mac-os-x-terminal-app/ | |
# New-BSD License by Original Author Daniel Doezema http://dan.doezema.com/licenses/new-bsd/ | |
# Modified by Luke Schoen in 2017 to include loading new tabs for Rails Server and automatically open webpage in browser. | |
# References: https://developer.apple.com/library/content/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html |
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
// Lexically nested function definitions defined within enclosing function | |
function Sum(arg0) { | |
function Inner1(arg1) { | |
function Inner2(arg2) { | |
return arg0 + arg1 + arg2; | |
} | |
return Inner2; | |
} | |
return Inner1; | |
} |
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
let mergeSort = (arr) => { | |
if (arr.length < 2) { | |
console.log("Merging len 1: ", arr); | |
return arr; | |
} | |
console.log("Merging len > 1: ", arr) | |
let mid = parseInt(arr.length / 2), | |
l = arr.slice(0, mid), |
OlderNewer