This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule CounterWeb.Counter do | |
use Phoenix.LiveView | |
def render(assigns) do | |
~L""" | |
<div> | |
<h1>The count is: <%= @val %></h1> | |
<button phx-click="dec">-</button> | |
<button phx-click="inc">+</button> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Usage: | |
# $ command | timing | |
# | |
# Example: | |
# $ rails server | timing | |
# 00:00:00 | rails server -b 0.0.0.0 | |
# 00:00:04 | => Booting Puma | |
# 00:00:04 | => Rails 5.1.3 application starting in development on http://0.0.0.0:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
# Activate the gem you are reporting the issue against. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=ERROR REPORT==== 7-Apr-2016::21:31:31 === | |
Error on AMQP connection <0.3317.0> (127.0.0.1:49193 -> 127.0.0.1:5672, vhost: '/', user: 'guest', state: running), channel 1: | |
{{{undef, | |
[{time_compat,erlang_system_time,[milli_seconds],[]}, | |
{rabbit_delayed_message,internal_delay_message,4, | |
[{file,"src/rabbit_delayed_message.erl"},{line,179}]}, | |
{rabbit_delayed_message,handle_call,3, | |
[{file,"src/rabbit_delayed_message.erl"},{line,118}]}, | |
{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,607}]}, | |
{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,639}]}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"query" => "\"\\n query IntrospectionQuery {\\n __schema {\\n queryType { name }\\n mutationType { name }\\n types {\\n ...FullType\\n }\\n directives {\\n name\\n description\\n args {\\n ...InputValue\\n }\\n onOperation\\n onFragment\\n onField\\n }\\n }\\n }\\n\\n fragment FullType on __Type {\\n kind\\n name\\n description\\n fields(includeDeprecated: true) {\\n name\\n description\\n args {\\n ...InputValue\\n }\\n type {\\n ...TypeRef\\n }\\n isDeprecated\\n deprecationReason\\n }\\n inputFields {\\n ...InputValue\\n }\\n interfaces {\\n ...TypeRef\\n }\\n enumValues(includeDeprecated: true) {\\n name\\n description\\n isDeprecated\\n deprecationReason\\n }\\n possibleTypes {\\n ...TypeRef\\n }\\n }\\n\\n fragment InputValue on __InputValue {\\n name\\n de |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Java Virtual Machine statistics monitoring tool (jstat -options for all the options) | |
$ jstat -gcutil process_id 1000 | |
S0 -> Survivors 0 | |
S1 -> Survivors 1 | |
E -> Eden | |
O -> Old | |
P -> Perm | |
YGC -> Young GC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PriorityQueue | |
attr_reader :elements | |
def initialize | |
@elements = [nil] | |
end | |
def <<(element) | |
@elements << element | |
bubble_up(@elements.size - 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generated with: | |
rvm-restart | |
rvm get head | |
echo 1.26.4 >| $rvm_path/VERSION | |
rvm-restart | |
( | |
export PS4="+ %* %F{red}%x:%I %F{green}%N:%i%F{white} %_" | |
set -o xtrace | |
rvm --trace install 2.2.0 2>&1 | tee big.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Found old RVM 1.26.4 - updating. | |
Downloading https://get.rvm.io | |
No GPG software exists to validate rvm-installer, skipping. | |
Downloading https://github.com/wayneeseguin/rvm/archive/master.tar.gz | |
Upgrading the RVM installation in /Users/brianstorti/.rvm/ | |
RVM PATH line found in /Users/brianstorti/.bashrc /Users/brianstorti/.zshrc. | |
RVM sourcing line found in /Users/brianstorti/.bash_profile /Users/brianstorti/.zlogin. | |
Upgrade of RVM in /Users/brianstorti/.rvm/ is complete. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
class Client | |
private | |
attr_reader :host, :port | |
public | |
def initialize(host, port) | |
@host, @port = host, port | |
end |
NewerOlder