Skip to content

Instantly share code, notes, and snippets.

View statik's full-sized avatar
😎
happily working! I may be slow to respond

Elliot Murphy statik

😎
happily working! I may be slow to respond
View GitHub Profile
@crashGoBoom
crashGoBoom / vid2gif.sh
Created August 27, 2019 18:55
Create a gif from mov file using FFMPEG
_video_file="${1}"
ffmpeg -i $_video_file -vf palettegen pal.png
ffmpeg -i $_video_file -i pal.png -lavfi paletteuse=bayer_scale=4:dither=bayer -r 18 video.gif
@mayneyao
mayneyao / notion2blog.js
Last active June 19, 2025 19:02
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@crashGoBoom
crashGoBoom / aws-iam-simulate.sh
Last active September 16, 2022 03:46
Use AWS IAM Policy Simulator with the CLI
# The action we want to test
_action="s3:GetObject"
# The JSON you want to convert to a string
_json_to_convert='{ "Version": "2012-10-17","Statement": [{"Effect": "Allow","Action": "*","Resource": "*"}]}'
# Your resource arn goes here
_resource_arn="arn:aws:s3:::${_some_s3_bucket}/${_some_prefix}/*"
# This command will format the json policy as a string for the cli to use
# echo ${_json_to_convert} | jq '[.|tostring]'
# But we will send it to a fifo with '<()' instead of creating a json file every time
@crashGoBoom
crashGoBoom / example_get_opts.sh
Created January 17, 2019 21:45
Example of parsing sub commands in a function with getopts
function get_help() {
cat <<help_message
--- script subcommand -------------------------------------------------------------
Commands related to this script
USAGE:
script command shell [FLAGS] [SUBCOMMAND]
@lissdy
lissdy / routes_csv.rake
Created August 7, 2018 06:31
Export rails routes to csv
namespace :routes do
desc 'Print out all defined routes in CSV format.'
task :csv => :environment do
class CSVFormatter
def initialize
@buffer = []
end
def result
@Piasy
Piasy / install_ffmpeg.sh
Last active June 4, 2025 06:30
brew install ffmpeg with all options
brew options ffmpeg
brew install ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-game-music-emu \
--with-libass \
@sators
sators / connect.php
Last active February 4, 2025 03:24
PHP MySQLi Amazon Aurora RDS EC2 IAM Role Based Authentication
<?php
/********* CONFIG ********/
$clusterEndpoint = "";
$clusterPort = 3306;
$clusterRegion = "us-east-1";
$dbUsername = "";
$dbDatabase = "";
/*************************/
@TheSeamau5
TheSeamau5 / multipageform.elm
Last active October 30, 2020 16:54
Simple multi-page form
import Html exposing (Html, Attribute)
import Html.Attributes
import Html.Events
import Signal exposing (Address)
import List
import String
import StartApp
------------------
--- HELPER CODE --
@keo
keo / bootstrap.sh
Last active January 25, 2024 15:49
Setup encrypted partition for Docker containers
#!/bin/sh
# Setup encrypted disk image
# For Ubuntu 14.04 LTS
CRYPTFS_ROOT=/cryptfs
apt-get update
apt-get -y upgrade
apt-get -y install cryptsetup
# Mac preference changes:
# * minimize and hide dock
# * undo natural scrolling
# * max out keyboard repeat
# * increase desktop resolution
# * show date in menubar
# * do not play feedback when volume is changed
# * do not play user interface sounds
# * maximize mouse tracking speed