Skip to content

Instantly share code, notes, and snippets.

View Stratus3D's full-sized avatar

Trevor Brown Stratus3D

View GitHub Profile
@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 March 24, 2025 13:36
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 March 3, 2025 13:56
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 March 29, 2025 16:53
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.

@gvaughn
gvaughn / VimAndGitCodeDemos.md
Last active August 29, 2015 14:03
Vim and Git in Code Demos

Vim and Git in Code Demos

I want to give a code demo that shows progression of the code. I thought it would be great if I could craft the series of commits on a branch and have a single vim keystroke that would checkout the next (or previous) commit and force my buffers to reload. That would allow me to show one commit, then give me the freedom to live code how the next step is done, but when I advance to the next commit I know I'll have working code. It's like a safety harness for live coding.

Here's how it's supposed to work:

  • I created a test_forward branch, and, yeah, it's hardcoded in the vimscript :-(
  • Then I created 3 consecutive commits with one line changes in my README
  • optional: I used "git tag $tag_name" to give a friendly name in my bash prompt for each commit (I wish the fugitive statusline would use it too though)
  • I checked out the 1st of the demo commits