View machine.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
let randomID = () => Math.random().toString(36).substring(7); | |
const addWriter = () => | |
assign({ | |
writers: (context, event) => [randomID(), ...context.writers] | |
}); | |
const addEditor = () => | |
assign({ |
View split_folder.sh
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
# split_folder | |
# | |
# Usage: | |
# split_folder NumberOfFilesPerFolder FileType | |
# | |
# Example: | |
# split_folder 100 "*.jpg" | |
# split_folder 250 "*.NEF" | |
function split_folder { |
View split_folder.sh
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 split_folder { | |
#Optional Positional Arguments | |
N_FILES=${1:-100} # Number of files you want in each folder. | |
FILES=${2:-"*.*"} # Filetype, accepts any string. | |
let m=0 # Loop vairable. | |
let M=0 # Folder name variable. | |
for i in $FILES; do |
View split_folder.sh
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 split_folder { | |
#Optional Positional Arguments | |
N_FILES=${1:-100} # Number of files you want in each folder. | |
FILES=${2:-"*.*"} # Filetype, accepts any string. | |
let m=0 # Loop vairable. | |
let M=0 # Folder name variable. | |
for i in $FILES; do |
View api1.feature
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
Feature: API User | |
Background: User setups | |
Given a user with name "userA" | |
And a user with name "userB" | |
Scenario Outline: A user and an admin tries to access /user routes | |
Given <name> has role <role> | |
When <method> of "/users" is accessed by userA | |
Then status <code> is returned |
View append.py
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
def append(data): | |
if not data.get('type',None): | |
return {'type':'object', 'properties':data} | |
else: | |
return data |
View enablePostgisFunctions.sh
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
psql username | |
CREATE EXTENSION cube; | |
CREATE EXTENSION earthdistance; |
View ko_selectize.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
var inject_binding = function (allBindings, key, value) { | |
//https://github.com/knockout/knockout/pull/932#issuecomment-26547528 | |
return { | |
has: function (bindingKey) { | |
return (bindingKey == key) || allBindings.has(bindingKey); | |
}, | |
get: function (bindingKey) { | |
var binding = allBindings.get(bindingKey); | |
if (bindingKey == key) { | |
binding = binding ? [].concat(binding, value) : value; |
View digits.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
//Include <script id="digits-sdk" src="https://cdn.digits.com/1/sdk.js" async></script> in <head></head> | |
document.getElementById('digits-sdk').onload = function() { | |
Digits.init({ consumerKey: 'NpImh5k6yWhDAyhiafRop44Ur' }) | |
.done(function(){ | |
console.log("Digits is initialized") | |
}) | |
.fail(function(){ | |
console.log("Digits failed to initialize") | |
}) |
View gist:f2eae0cee36f54d6fb56
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
from authomatic import Authomatic | |
authomatic = Authomatic(app.config['AUTHOMATIC'], app.config['SECRET_KEY'], report_errors=False) | |
@user.route('/login/<provider_name>/', methods=['GET', 'POST']) | |
def login_social(provider_name): | |
""" | |
Login handler, must accept both GET and POST to be able to use OpenID. | |
From the example at http://peterhudec.github.io/authomatic/examples/flask-simple.html | |
""" | |
NewerOlder