Skip to content

Instantly share code, notes, and snippets.

View andrewcmyk's full-sized avatar

Andrew Le andrewcmyk

View GitHub Profile
abelorian / agora.rb
Last active September 22, 2023 11:35
Agora dynamic Key ruby RTC example. Gem agora_dynamic_key
# In Gemfile: gem 'agora_dynamic_key', '~> 0.1.0'
require 'dynamic_key'
class Agora
def generate_rtc_token channel_name = 'any_channel_name'
params = {
steven2358 /
Last active April 5, 2024 19:35
FFmpeg cheat sheet
sscotth / keystroke the clipboard extended.workflow
Last active January 2, 2024 12:12
Paste as keystrokes (macOS)
# Why?
# To paste text into windows that normally don't allow it or have access to the clipboard.
# Examples: Virtual machines that do not yet have tools installed, websites that hijack paste
# Extended vs Simple?
# * Includes an initial delay to allow you to change active windows
# * Adds small delay between keypresses for slower responding windows like SSH sessions
# * Better handling of numbers
# * VMWare bug fix
CaptEmulation / tax.js
Last active February 6, 2016 02:49
2014 Bitcoin taxes cost basis and income calculations. Uses Libra Tax files as input
var argv = require('minimist')(process.argv.slice(2));
var fs = require('fs');
var csvParse = require('csv-parse');
var csvStringify = require('csv-stringify');
var moment = require('moment');
if (argv._.length === 0) {
console.log('Usage: node tax --year 2014 Libra.csv output.csv');
bitkidd /
Last active October 17, 2023 18:58
AWS S3 backup for Vesta

Before doing all this you have to create a bucket in your AWS console. Or just use AWS cli tool in order to create one.

  • Install pip (if not installed already):
$ curl -O
  • Install AWS cli tool:
$ sudo pip install awscli
chrisvanpatten /
Last active September 18, 2020 14:16
Super-simple way to grab a few Instagram images and cache them w/ WordPress

This is an easy way to integrate a basic Instagram feed into a WordPress site.


First, register with Instagram's developer program, then register a client. Set the client ID they provide you in line 4.

Second, get your Instagram user ID by running this in your terminal:

curl -X GET\?q\=USERNAME\&client_id\=CLIENT_ID
kaloprominat / macos: manage add list remove login items apple script
Last active April 11, 2024 23:22
macos: manage add list remove login items apple script
# applescript
# add login item
osascript -e 'tell application "System Events" to make login item at end with properties {name: "Notes",path:"/Applications/", hidden:false}'
# delete login item
osascript -e 'tell application "System Events" to delete login item "itemname"'
# list loginitems
osascript -e 'tell application "System Events" to get the name of every login item'
meleyal /
Last active May 18, 2023 19:40
OSX defaults, based on
# OSX defaults, based on
# Ask for the administrator password upfront
sudo -v
# Set computer name (as done via System Preferences → Sharing)
sudo scutil --set ComputerName "air"
sudo scutil --set HostName "air"
wrburgess / gist:5528649
Last active November 24, 2022 15:29
Backup Heroku Postgres database and restore to local database

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production

feedmeastraycat / get_post_id_by_meta_key_and_value.php
Created July 7, 2012 11:32
WordPress: Get post id by meta key and value
if (!function_exists('get_post_id_by_meta_key_and_value')) {
* Get post id from meta key and value
* @param string $key
* @param mixed $value
* @return int|bool
* @author David M&aring;rtensson <>
function get_post_id_by_meta_key_and_value($key, $value) {