Skip to content

Instantly share code, notes, and snippets.

View joshtronic's full-sized avatar
🐢
🐢 🐢 🐢

Josh Sherman joshtronic

🐢
🐢 🐢 🐢
View GitHub Profile
@joestump
joestump / test.tf
Last active October 11, 2024 16:44
Trigger AWS CodePipeline with a GitHub webhook using Terraform
provider "aws" {}
provider "github" {}
resource "github_repository" "test" {
name = "joestump-test"
description = "Terraform test repository"
private = true
}
resource "aws_s3_bucket" "test" {
@todmephis
todmephis / brew-update-notifier.sh
Last active September 19, 2024 14:01 — forked from streeter/brew-update-notifier.sh
Homebrew Package Update Notifications on macOS Mojave
#!/bin/bash
#
# Notify of Homebrew updates via Notification Center on macOS
# Forked from: https://gist.github.com/streeter/3254906
# https://github.com/julienXX/terminal-notifier
# https://github.com/vjeantet/alerter
# Author: Ivan Sanchez https://todmephis.cf/
# Twetter: https://twitter.com/todmephis
# Requires: terminal-notifier, alerter. Install with:
# brew install terminal-notifier
@wmertens
wmertens / slateToReact.js
Created July 6, 2018 05:17
Convert Slate JSON object to React element tree
@@ -0,0 +1,62 @@
import React from 'react'
import RULES from './somewhere' // What you normally feed slate-html-serializer
const rules = [
...RULES,
// from slate-html-serializer
{
serialize(obj, children) {
if (obj.object === 'string') {
@Soben
Soben / beanstalk-backup.sh
Created June 7, 2018 12:19
Quick Git Backup and Zip
function bsbb {
currentDate=`date +"%Y%m%d"`
if [ "$1" ]; then
printf "${COLOR_YELLOW}Getting repository${COLOR_DEFAULT}\n"
git clone "[email protected]:/TEAMNAME/$1.git" || return 1
printf "${COLOR_YELLOW}Zipping up folder${COLOR_DEFAULT}\n"
zip -qr "$1-$currentDate.zip" "$1/"
if [ $? -eq 1 ]; then
rm -rf ./*
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active December 3, 2024 21:48
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@matijs
matijs / README.md
Last active June 24, 2024 23:41
Solarized Dark profile for macOS Terminal.app

Solarized Dark profile for Terminal.app on macOS High Sierra

Based on the excellent Solarized (Dark) created by Ethan Schoonover. For source code, check the main Solarized repository on GitHub.

Installation

Open and save Solarized Dark.terminal.

Import from the “Profiles” tab in the settings of Terminal.app or just double-click the file after downloading.

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 30, 2025 05:50 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@jcouyang
jcouyang / README.org
Last active March 13, 2025 19:28
Promise All with Limit of Concurrent N

The Promise All Problem

in case of processing a very large array e.g. Promise.all(A_VERY_LARGE_ARRAY_OF_XHR_PROMISE)

which would probably blow you browser memory by trying to send all requests at the same time

solution is limit the concurrent of requests, and wrap promise in thunk

Promise.allConcurrent(2)([()=>fetch('BLAH1'), ()=>fetch('BLAH2'),...()=>fetch('BLAHN')])

@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active April 28, 2025 17:43
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@xflr6
xflr6 / gsheets.py
Last active December 7, 2023 15:37
Download all sheets of a Google Docs spreadsheet and export to individual CSV files
"""Download all sheets of a Google Docs spreadsheet as CSV."""
import contextlib, csv, itertools, os
from apiclient.discovery import build # pip install google-api-python-client
SHEET = '1dR13B3Wi_KJGUJQ0BZa2frLAVxhZnbz0hpwCcWSvb20'
def get_credentials(scopes, *, secrets='~/client_secrets.json', storage='~/storage.json'):