Skip to content

Instantly share code, notes, and snippets.

Gary Rennie Gazler

Block or report user

Report or block Gazler

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
View aoc_day5.ex
defmodule Advent2018.Day5 do
def solve(input) do
parse_polymers(input, <<>>, nil)
end
def parse_polymers(<<>>, acc, _), do: byte_size(acc)
def parse_polymers(
<<a::size(2), _::size(1), b::size(5), rest::binary>>,
seen,
View day5.ex
defmodule Advent2018.Day5 do
def solve(input) do
parse_polymers(input, <<>>)
end
def parse_polymers(<<>>, acc), do: byte_size(acc)
def parse_polymers(<<a, rest :: binary>>, <<b, seen :: binary>>) when abs(a-b) == 32 do
parse_polymers(rest, seen)
end
View webpack.config.js
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: './js/app.js',
stats: {
colors: true,
children: false,
modules: false,
View gist:a3e8f2d83aa17a17e9ad9df5bb70374f
(not in a group)
Phoenix
Phoenix.Digester
Phoenix.Logger
Phoenix.Naming
Phoenix.Token
CHANNELS AND TRANSPORTS
Phoenix.Channel
Phoenix.Presence
View keybase.md

Keybase proof

I hereby claim:

  • I am gazler on github.
  • I am gazler (https://keybase.io/gazler) on keybase.
  • I have a public key ASC34A5fIJLkSPcG8rrYwIvYCbzfb9hiktqZ8ES65JTX1go

To claim this, I am signing this object:

View new_pid.ex
{:new_transport_pid,
[current_function: {Process, :info, 1}, initial_call: {:proc_lib, :init_p, 5},
status: :running, message_queue_len: 0, messages: [], links: [#PID<0.249.0>],
dictionary: ["$initial_call": {:cowboy_tls, :proc_lib_hack, 5},
"$ancestors": [#PID<0.249.0>, #PID<0.248.0>, :ranch_sup, #PID<0.209.0>]],
trap_exit: true, error_handler: :error_handler, priority: :normal,
group_leader: #PID<0.208.0>, total_heap_size: 2208, heap_size: 1598,
stack_size: 21, reductions: 1728,
garbage_collection: [max_heap_size: %{error_logger: true, kill: true,
size: 0}, min_bin_vheap_size: 46422, min_heap_size: 233,
View Option 3.txt
* Install dependencies with `mix deps.get`<%= if ecto do %>
* Create and migrate your database with `mix ecto.create && mix ecto.migrate`<% end %><%= if html do %>
* Install Node.js dependencies with `npm install`<% end %>
* Start Phoenix endpoint with `mix phoenix.server`
View checkout_tag.rb
difficulty 2
description "You need to fix a bug in the version 1.2 of your app. Checkout the tag `v1.2`."
setup do
repo.init
FileUtils.touch("app.rb")
repo.add("app.rb")
repo.commit_all("Initial commit")
View master_proxy.ex
defmodule MasterProxy do
use Application
# See http://elixir-lang.org/docs/stable/elixir/Application.html
# for more information on OTP Applications
def start(_type, _args) do
import Supervisor.Spec, warn: false
cowboy = Plug.Adapters.Cowboy.child_spec(:http, MasterProxy.Plug, [])
View setup.sh
sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
ulimit -n 4000000
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
sysctl -w net.ipv4.tcp_rmem='1024 4096 16384'
sysctl -w net.ipv4.tcp_wmem='1024 4096 16384'
sysctl -w net.core.rmem_max=16384
sysctl -w net.core.wmem_max=16384
wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
You can’t perform that action at this time.