Skip to content

Instantly share code, notes, and snippets.

View charltoons's full-sized avatar
🔆

Charlton Roberts charltoons

🔆
View GitHub Profile
// This is a partial script to get the Table of the current record.
// It allows you to avoid hardcoding the table name in `base.getTable()`.
// You need to set up an input of the current Record URL using the name `recordUrl`.
const inputConfig = input.config()
const recordUrl = new URL(inputConfig.recordUrl)
const tableId = recordUrl.pathname.split('/')[2]
const table = base.getTable(tableId)

Keybase proof

I hereby claim:

  • I am charltoons on github.
  • I am charltoons (https://keybase.io/charltoons) on keybase.
  • I have a public key ASDi__r_5c91VtKe9HJyhdFURdpNa7toAbHmhdehsOy-Mgo

To claim this, I am signing this object:

@charltoons
charltoons / video.sh
Created August 6, 2019 19:03
Web Video Optimization
# play with "3000k" until you are comfortable with video quality and filesize
ffmpeg -i input.mp4 -threads 8 -b:v 3000k -strict experimental -vf scale=2500:-1 output.mp4
@charltoons
charltoons / now-private-key-secret.sh
Created March 17, 2019 18:53
Adding a private key file to a Now.sh Secret
MY_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nABC...123=\n-----END PRIVATE KEY-----\n"
now secret add my-private-key $(echo $MY_PRIVATE_KEY | base64)
Verifying my Blockstack ID is secured with the address 16MerBn16CxqEb7xZaXzCeHNM9d299HJYA https://explorer.blockstack.org/address/16MerBn16CxqEb7xZaXzCeHNM9d299HJYA
@charltoons
charltoons / autoconfirm.js
Created August 26, 2017 14:21
AWS Cognito Lambda PreSignup Auto-Confirm Trigger
'use strict';
exports.handler = (event, context, callback) => {
console.log('Received event:', JSON.stringify(event, null, 2))
const modifiedEvent = event
// check that we're acting on the right trigger
if (event.triggerSource === "PreSignUp_SignUp"){
// auto confirm the user
#!/bin/sh
palette="/tmp/palette.png"
filters="fps=12,scale=768:-1:flags=lanczos"
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y /tmp/gif.gif
gifsicle -O3 --no-extensions -o $2 --dither --colors 256 /tmp/gif.gif
@charltoons
charltoons / Maintenance Monday OSX
Last active August 29, 2015 14:00
Maintenance Monday - update your shit!
#######################################
############## HOMEBREW ###############
#######################################
printf "\n\n---> Updating Homebrew\n"
# update homebrew
brew update
# update all homebrew packages
@charltoons
charltoons / colorInBetween.js
Created May 6, 2013 02:35
Finds the color in between two colors.
function colorInBetween(color1, color2){
function toNumber(hexStr){ return parseInt('0x'+hexStr); }
function toColorObject(color){
var obj = {};
obj.red = toNumber(color.slice(1,3));
obj.green = toNumber(color.slice(3,5));
obj.blue = toNumber(color.slice(5,7));
return obj;
}
function getAverage(val1, val2){
@charltoons
charltoons / Projeqt.com
Created April 8, 2013 18:34
Testing out embeds in Projeqt.com
first_name = "Charlton"
full_name = "#{firs_name} Roberts"
alert(full_name)