Navigation Menu

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
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
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
@cblavier
cblavier / application.ex
Last active April 30, 2023 08:33
Cowboy 2.5 proxy, used to bind a single port (on Heroku) for umbrella Phoenix applications. It supports HTTPS and websockets properly.
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
tenderlove / z-wave-uart.md
Created February 4, 2018 00:41
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.

Packets

@chrismccord
chrismccord / upgrade.md
Last active April 7, 2023 12:03
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: https://www.youtube.com/watch?v=tMO28ar0lW8

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

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

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
ryanwinchester / fix-laravel-debian.sh
Last active February 28, 2017 20:55
Solve all Laravel problems with one script
#!/bin/bash
if [[ -z "$1" ]] ; then
echo 'Need path to app dir'
exit 1
fi
app_path="$1"
# Laravel Console Commands to fix problems
@paulgoetze
paulgoetze / codeship-elixir.sh
Last active July 30, 2018 03:33
Codeship Elixir/Phoenix test setup
#!/bin/bash
# Erlang
ERLANG_VERSION=${ERLANG_VERSION:-20.2}
ERLANG_CACHED_DOWNLOAD="${HOME}/cache/OTP-${ERLANG_VERSION}.tar.gz"
ERLANG_DIR=${ERLANG_DIR:="$HOME/erlang"}
# Elixir
ELIXIR_VERSION=${ELIXIR_VERSION:-1.6.3}
ELIXIR_CACHED_DOWNLOAD="${HOME}/cache/elixir-v${ELIXIR_VERSION}.zip"
# Before Script
before_script:
- composer self-update
- composer install --prefer-dist > /dev/null
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh
# Services
services:
@JeffreyWay
JeffreyWay / .bash_profile
Created July 31, 2015 19:20
Prettier git logs
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
JeffreyWay / countries.php
Created July 23, 2015 17:01
Country Names + Codes
[
"United States" => "us",
"Afghanistan" => "af",
"Albania" => "al",
"Algeria" => "dz",
"American Samoa" => "as",
"Andorra" => "ad",
"Angola" => "ad",
"Anguilla" => "ai",
"Antarctica" => "aq",
@tott
tott / ip_in_range.php
Created November 27, 2013 22:46
php check if IP is in given network range
/**
* Check if a given ip is in a network
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 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';
}