Skip to content

Instantly share code, notes, and snippets.

View owenandrews's full-sized avatar

Owen Andrews owenandrews

View GitHub Profile
/*
From Cassidy Williams' weekly newsletter (https://click.pstmrk.it/2sm/buttondown.email%2Fcassidoo%2Fsubscribers%2F4d5ba807-3668-4d77-9db5-4e3303c0f3a9%2Farchive%2Fkeep-your-face-always-toward-the-sunshine-and/WPtx8C0N/bP1H/IfMBgFIdr5/OGIyZDRjMjctMTAzMy00Y2Y2LWI2YWMtZjVlNTRiOWFmNDA1)
Write a function that determines if all the characters in a given string are unique. Can you do this without making any new variables? You choose if you want to include capitalization in your consideration for this one, as a fun challenge.
Example:
> allUnique('Cassidy')
> false
@owenandrews
owenandrews / ffmpeg.md
Last active September 6, 2019 00:13
Handy ffmpeg commands

Handy ffmpeg commands

Extract frame from video (replace x with desired frame number)
ffmpeg -i <input> -vf "select=eq(n\,x)" -vframes 1 poster.png

Recompress MP4 (replace x with desired bytes/s e.g. 10000)
ffmpeg -i <input>.mp4 -b x <output>.mp4

Convert PNG sequence to Prores 422 (expects file names incrementing from 0000000.png)
ffmpeg -r 25 -f image2 -i %07d.png -c:v prores_aw -profile:v 1 -pix_fmt yuv422p10 -r 25 .mov

@owenandrews
owenandrews / google-oauth2.php
Created March 29, 2018 05:10
Bare Bones Google OAuth
<?php
// composer require google/apiclient:^2.0
require_once __DIR__.'/vendor/autoload.php';
const CLIENT_ID = '';
const CLIENT_SECRET = '';
const APPLICATION_NAME = "";
const REDIRECT_URI = "http://localhost:8080/";
@owenandrews
owenandrews / colors.php
Created December 3, 2017 23:36
PHP Google Material Design Primary Colors
$colors = [
'#F44336',
'#E91E63',
'#9C27B0',
'#673AB7',
'#3F51B5',
'#2196F3',
'#03A9F4',
'#00BCD4',
'#009688',

Keybase proof

I hereby claim:

  • I am owenandrews on github.
  • I am owenandrews (https://keybase.io/owenandrews) on keybase.
  • I have a public key ASCKcifz7Zf6BUEYigrWjGHaPr-krmUzSe2SCpRvZfof8Qo

To claim this, I am signing this object: