Skip to content

Instantly share code, notes, and snippets.

Avatar
🕴️

Nate Vick nvick

🕴️
View GitHub Profile
@nvick
nvick / Dockerfile
Last active Jul 25, 2020
Base Rails Docker Development Environment
View Dockerfile
ARG RUBY_VERSION=2.6
FROM ruby:$RUBY_VERSION
ARG DEBIAN_FRONTEND=noninteractive
ARG NODE_VERSION=11
RUN curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
View Signals_On_Ubuntu-19.10.txt
{"EXIT"=>0, "HUP"=>1, "INT"=>2, "QUIT"=>3, "ILL"=>4, "TRAP"=>5, "ABRT"=>6, "IOT"=>6, "FPE"=>8, "KILL"=>9, "BUS"=>7, "SEGV"=>11, "SYS"=>31, "PIPE"=>13, "ALRM"=>14, "TERM"=>15, "URG"=>23, "STOP"=>19, "TSTP"=>20, "CONT"=>18, "CHLD"=>17, "CLD"=>17, "TTIN"=>21, "TTOU"=>22, "IO"=>29, "XCPU"=>24, "XFSZ"=>25, "VTALRM"=>26, "PROF"=>27, "WINCH"=>28, "USR1"=>10, "USR2"=>12, "PWR"=>30, "POLL"=>29}
View capybara_initializer_rails_4.rb
class CapybaraInitializer
attr_accessor :headless, :context
alias :headless? :headless
def initialize
@headless = true
end
def call
View docker-database.yml
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS", 5) %>
username: <%= ENV.fetch("DATABASE_USER", 'postgres') %>
host: <%= ENV.fetch("DATABASE_HOST", 'localhost') %>
port: 5432
development:
<<: *default
@nvick
nvick / docker-pry-rails.md
Created Nov 23, 2019 — forked from briankung/docker-pry-rails.md
Using pry-rails with Docker
View docker-pry-rails.md

First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails

gem 'pry-rails', group: :development

Then you'll want to rebuild your Docker container to install the gems

View fizzbuzz_patt.ex
defmodule FizzbuzzPatt do
def run(number) when rem(number, 15) == 0 do
"FizzBuzz"
end
def run(number) when rem(number, 5) == 0 do
"Buzz"
end
def run(number) when rem(number, 3) == 0 do
"Fizz"
end
View keybase.md

Keybase proof

I hereby claim:

  • I am nvick on github.
  • I am natevick (https://keybase.io/natevick) on keybase.
  • I have a public key whose fingerprint is 4C84 7EA0 D91A B430 7EFC C0CF 0A37 1161 9503 F13E

To claim this, I am signing this object:

View gist:b8f87b02498dd7a43bbc
[1] pry(main)> data = "Vare, very confidential data"
=> "Vare, very confidential data"
[2] pry(main)> require "openssl"
=> true
[3] pry(main)> cipher = OpenSSL::Cipher::AES.new(128, :CBC)
=> #<OpenSSL::Cipher::AES:0x007f9332ca8df8>
[4] pry(main)> cipher.encrypt
=> #<OpenSSL::Cipher::AES:0x007f9332ca8df8>
[5] pry(main)> key = cipher.random_key
=> "\xFE\xCF\xF8G}\xE5\xCE\xCD\x9CP+\xBF\xC1)?j"
View wufoo-raw-body
FieldStructure=%7B%22Fields%22%3A%5B%7B%22Title%22%3A%22Event+Name%22%2C%22Instructions%22%3A%22Enter+the+name+of+the+event+as+you%27d+like+it+to+appear+to+the+public.%22%2C%22IsRequired%22%3A%221%22%2C%22ClassNames%22%3A%22%22%2C%22DefaultVal%22%3A%22%22%2C%22Page%22%3A%221%22%2C%22Type%22%3A%22text%22%2C%22ID%22%3A%22Field1%22%7D%2C%7B%22Title%22%3A%22Short+Description%22%2C%22Instructions%22%3A%22Enter+a+one+sentence+summary+of+the+event.%22%2C%22IsRequired%22%3A%221%22%2C%22ClassNames%22%3A%22%22%2C%22DefaultVal%22%3A%22%22%2C%22Page%22%3A%221%22%2C%22Type%22%3A%22text%22%2C%22ID%22%3A%22Field3%22%7D%2C%7B%22Title%22%3A%22Detailed+Description%22%2C%22Instructions%22%3A%22Enter+all+the+details+about+your+event+you+will+want+the+public+to+know.+Please+be+as+descriptive+and+detailed+as+possible.%22%2C%22IsRequired%22%3A%221%22%2C%22ClassNames%22%3A%22%22%2C%22DefaultVal%22%3A%22%22%2C%22Page%22%3A%221%22%2C%22Type%22%3A%22textarea%22%2C%22ID%22%3A%22Field2%22%7D%2C%7B%22Title%22%3A%22Event+Start+Date%22%2C%2
You can’t perform that action at this time.