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({ |
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 { |
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 |
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 |
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 |
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 |
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; |
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
import exifread | |
# Open image file for reading (binary mode) | |
i = 1 | |
with open("~/timelapse/files.txt", "r") as fn: | |
for line in fn: | |
f = open("/home/tejovanth/timelapse/src/"+line[:-1], 'rb') | |
# Return Exif tags | |
tags = exifread.process_file(f) |
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; |
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") | |
}) |
NewerOlder