Skip to content

Instantly share code, notes, and snippets.

View Stratus3D's full-sized avatar

Trevor Brown Stratus3D

View GitHub Profile
#!/bin/bash
SOURCE=/tmp/int.erl
COMPILED=/tmp/int.beam
test -e $SOURCE || curl https://raw.githubusercontent.com/josevalim/otp/c7e82c6b406b632a191c791a1bd2162bde08f692/lib/debugger/src/int.erl > $SOURCE
erlc -o ${COMPILED%int.beam} $SOURCE
chmod 444 $COMPILED
chgrp admin $COMPILED
@unix1
unix1 / rle.erl
Created February 25, 2016 06:23
Implementation of Run-length encoding algorithm in Erlang. Both encode and decode functions are provided. For more info see https://en.wikipedia.org/wiki/Run-length_encoding and http://rosettacode.org/wiki/Run-length_encoding - the latter has a couple of implementations in Erlang, but I like using lists:foldr/3 this way.
-module(rle).
-export([encode/1]).
-export([decode/1]).
encode(List) ->
lists:flatten(lists:foldr(
fun (Prev, [[Count, Prev]|Rest]) ->
[[Count + 1, Prev]|Rest];
(Current, Acc) ->
//
// ReserveAmerica auto clicker v2
// Wade Brainerd <[email protected]>
//
// This script repeatedly clicks the Book these Dates button
// for a ReserveAmerica campsite, e.g. Bahia Honda. Given a
// start time and duration, it will repeatdly click the button
// until the button disappears or the duration expires.
//
// Usage:
@bishboria
bishboria / springer-free-maths-books.md
Last active September 14, 2025 20:30
Springer made a bunch of books available for free, these were the direct links
@mnot
mnot / snowden-ietf93.md
Last active November 5, 2024 06:22
Transcript of Edward Snowden's comments at IETF93.
@Timothee
Timothee / _command_runner.sh
Last active September 29, 2022 00:50
This function lets you easily create series of commands into a single call # It will print each successive command, run it and, as long as it returned # with code 0, continue to the next step. # If any step fails, it will stop and let you pick it back up after you fix the # issues.
#!/usr/bin/env bash
# This function lets you easily create series of commands into a single call
# It will print each successive command, run it and, as long as it returned
# with code 0, continue to the next step.
# If any step fails, it will stop and let you pick it back up after you fix the
# issues.
#
# Example of script using this function:
# !/usr/bin/env bash
@blech75
blech75 / README.md
Last active March 19, 2024 00:50
notify-send adapter

notify-send adapter for Mac OS X

This allows you to receive desktop notifications from grunt running inside of a local vagrant box.

How to install

Install grunt-notify and add to dev dependencies

This is done on the guest VM (within the vagrant box).

@landed1
landed1 / gist:9361d68a90e87a2b92cf
Last active December 4, 2015 00:37
Angular Modal directive using Refils
Using this modal found here - http://refills.bourbon.io/components/ copy the css as is and note the source of the custom modal directive will be the html plus some amends shown below.
add the modal (modal-dialog tag) to your Angular template file and add a couple of native directives to the body tag
ex
<body ng-app="baApp" ng-controller="MainCtrl" data-ng-init="init()" ng-class="{open: modalFlag, closed: !modalFlag}">
<modal-dialog></modal-dialog>
(create a new template file 'modal.html') add code to modal.html
@pnc
pnc / observer.md
Last active April 1, 2025 21:38
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
@grugq
grugq / gist:03167bed45e774551155
Last active September 18, 2025 21:03
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.