Skip to content

Instantly share code, notes, and snippets.

View ryanwinchester's full-sized avatar
⚗️
Working on open-source and side projects

Ryan Winchester ryanwinchester

⚗️
Working on open-source and side projects
View GitHub Profile
@ryanwinchester
ryanwinchester / chapter-1-part-1.md
Last active May 2, 2022 15:28
Chapter 1 - Take the Red Pill (this chapter name has not aged well)

CHAPTER 1 – Take the Red Pill (cringe)

The Elixir programming language wraps functional programming with im mutable state and an actor-based approach to concurrency in a tidy, modern syntax. And it runs on the industrial-strength, high-performance, distributed Erlang VM. But what does all that mean?

It means you can stop worrying about many of the difficult things that currently consume your time. You no longer have to think too hard about protecting your data consistency in a multithreaded environment. You worry less

@ryanwinchester
ryanwinchester / twilio_signature.ex
Last active November 8, 2021 15:40
Twilio signature module
defmodule TwilioSignature do
@moduledoc """
Twilio signatures module.
"""
@doc """
Generate the Twilio signature from a request.
See: https://www.twilio.com/docs/usage/security#validating-requests
@ryanwinchester
ryanwinchester / twittermute.txt
Created May 11, 2021 22:36 — forked from IanColdwater/twittermute.txt
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
[
0,
1,
1,
2,
3,
5,
8,
13,
21,
import Enum;c=String.replace("example string",~r/[\W_]/,"")|>String.split("",trim: true);zip(c,slice(c,1..-1))|>map(fn{a,b}->a<>b end)|>join(" ") end end
@ryanwinchester
ryanwinchester / gencert.sh
Created December 27, 2019 21:30 — forked from crpietschmann/gencert.sh
OpenSSL Generate 4096-bit Certificate (Public/Private Key Encryption) with SHA256 Fingerprint
# Generate Private Key and Certificate using RSA 256 encryption (4096-bit key)
openssl req -x509 -newkey rsa:4096 -keyout privatekey.pem -out certificate.pem -days 365
# Alternatively, setting the "-newkey" parameter to "rsa:2048" will generate a 2048-bit key.
# Generate PKCS#12 (P12) file for cert; combines both key and certificate together
openssl pkcs12 -export -inkey privatekey.pem -in certificate.pem -out cert.pfx
# Generate SHA256 Fingerprint for Certificate and export to a file
openssl x509 -noout -fingerprint -sha256 -inform pem -in certificate.pem >> fingerprint.txt
@ryanwinchester
ryanwinchester / gen-ca.sh
Last active December 26, 2019 08:30 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.
#!/bin/bash
###### PICK ONE OF THE TWO FOLLOWING ######
# OPTION ONE: RSA key. these are very well-supported around the internet.
# you can swap out 4096 for whatever RSA key size you want. this'll generate a key
# with password "xxxx" and then turn around and re-export it without a password,
# because genrsa doesn't work without a password of at least 4 characters.
#
# some appliance hardware only works w/2048 so if you're doing IOT keep that in
@ryanwinchester
ryanwinchester / remote-node.sh
Created September 5, 2018 18:14
You can run observer locally for a remote node
#!/bin/sh
set -e
BEAM_PORT=32815
EPMD_PORT=4369
COOKIE='cookiestring'
ssh -f -o ExitOnForwardFailure=yes \
-L "$EPMD_PORT:localhost:$EPMD_PORT" \
@ryanwinchester
ryanwinchester / poker.exs
Last active May 15, 2018 21:50
Just having fun...
defmodule Poker do
@deck ~w(
A♣ 2♣ 3♣ 4♣ 5♣ 6♣ 7♣ 8♣ 9♣ 10♣ J♣ Q♣ K♣
A◆ 2◆ 3◆ 4◆ 5◆ 6◆ 7◆ 8◆ 9◆ 10◆ J◆ Q◆ K◆
A♠ 2♠ 3♠ 4♠ 5♠ 6♠ 7♠ 8♠ 9♠ 10♠ J♠ Q♠ K♠
A♥ 2♥ 3♥ 4♥ 5♥ 6♥ 7♥ 8♥ 9♥ 10♥ J♥ Q♥ K♥
)
def deck, do: Enum.with_index(@deck)