Skip to content

Instantly share code, notes, and snippets.

Working at work and at home

Ryan Winchester ryanwinchester

Working at work and at home
Block or report user

Report or block ryanwinchester

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
cblavier / application.ex
Last active May 25, 2020
Cowboy 2.5 proxy, used to bind a single port (on Heroku) for umbrella Phoenix applications. It supports HTTPS and websockets properly.
View application.ex
defmodule MasterProxy.Application do
alias MyApp.Endpoint, as: MyAppEndpoint
alias MyApp.UserSocket, as: MyAppUserSocket
alias MyOtherApp.Endpoint, as: MyOtherAppEndpoint
alias MyOtherApp.UserSocket, as: MyOtherAppUserSocket
alias Phoenix.LiveReloader.Socket, as: LiveReloadSocket
alias Plug.Cowboy
tenderlove /
Created Feb 4, 2018
Aeotec Z-Wave Z-Stick Gen 5 UART protocol

Z-Stick Serial API

The Z-Stick does bi-directional communication over a UART. The connection speed is 115200, '8N1'. There are "requests" and "responses". The client software can make requests to the Z-Stick, and it will send responses. But it seems the Z-Stick can make requests of the client software too. I have yet to figure out the requests the Z-Stick sends to the client software.


chrismccord /
Last active Oct 27, 2019
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote:

To use the new project generator, you can install the archive with the following command:

$ mix archive.install

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:

ryanwinchester /
Last active Feb 28, 2017
Solve all Laravel problems with one script
if [[ -z "$1" ]] ; then
echo 'Need path to app dir'
exit 1
# Laravel Console Commands to fix problems
paulgoetze /
Last active Jul 30, 2018
Codeship Elixir/Phoenix test setup
# Erlang
# Elixir
View .gitlab-ci.yml
# Before Script
- composer self-update
- composer install --prefer-dist > /dev/null
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh
# Services
View .bash_profile
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
JeffreyWay / countries.php
Created Jul 23, 2015
Country Names + Codes
View countries.php
"United States" => "us",
"Afghanistan" => "af",
"Albania" => "al",
"Algeria" => "dz",
"American Samoa" => "as",
"Andorra" => "ad",
"Angola" => "ad",
"Anguilla" => "ai",
"Antarctica" => "aq",
tott / ip_in_range.php
Created Nov 27, 2013
php check if IP is in given network range
View ip_in_range.php
* Check if a given ip is in a network
* @param string $ip IP to check in IPV4 format eg.
* @param string $range IP/CIDR netmask eg., also is accepted and /32 assumed
* @return boolean true if the ip is in this range / false if not.
function ip_in_range( $ip, $range ) {
if ( strpos( $range, '/' ) == false ) {
$range .= '/32';
plentz / nginx.conf
Last active May 29, 2020
Best nginx configuration for improved security(and performance). Complete blog post here
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
You can’t perform that action at this time.