Skip to content

Instantly share code, notes, and snippets.

View tylerjohnst's full-sized avatar
:fishsticks:

Tyler Johnston tylerjohnst

:fishsticks:
  • GitHub Staff
  • Saint Petersburg, FL
View GitHub Profile
/script PlayerFrame:ClearAllPoints()
/script PlayerFrame:SetPoint("RIGHT", UIParent, "CENTER", -250, 250)
/run PlayerFrame:SetUserPlaced(true)
/script TargetFrame:ClearAllPoints()
/script TargetFrame:SetPoint("LEFT", PlayerFrame, "RIGHT", 20, 0)
/run TargetFrame:SetUserPlaced(true)
/script FocusFrame:ClearAllPoints()
/script FocusFrame:SetPoint("TOP", PlayerFrame, "BOTTOM", 50, 0)
def create
@user = User.find_by_email params[:email]
if @user && @user.valid_password?(password)
return redirect_to_oauth_complete(@user.account) if oauth_session?
sign_in @user
redirect_to [:dashboard]
else
flash[:error] = 'You have entered an invalid email or password. Please try again.'
render :new
def insertion_sort(collection)
collection.count.times do |i|
index = i
next if index.zero?
right_value = collection[i]
while index > 0
index -= 1
left_value = collection[index]
if right_value < left_value
/var/folders/5y/csxbdjv156n4fl25975s1x4w0000gn/T/ruby-build.20160921182951.4002 ~/.rbenv/versions
/var/folders/5y/csxbdjv156n4fl25975s1x4w0000gn/T/ruby-build.20160921182951.4002/ruby-2.3.1 /var/folders/5y/csxbdjv156n4fl25975s1x4w0000gn/T/ruby-build.20160921182951.4002 ~/.rbenv/versions
checking for ruby... /usr/local/bin/ruby
config.guess already exists
config.sub already exists
checking build system type... x86_64-apple-darwin16.0.0
checking host system type... x86_64-apple-darwin16.0.0
checking target system type... x86_64-apple-darwin16.0.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
Foo
Bar
Baz
Bing
class Command
def initialize(command, target, script, uses_bash)
@command, @target, @script, @uses_bash = command, target, script, uses_bash
end
def result
command == :exec ? exec_command : run_command
end
def exec_command
version: '2'
services:
test:
environment:
ENV_TWO: 'overridden'
@tylerjohnst
tylerjohnst / maybe.rb
Last active February 8, 2019 21:32
Don't do this in production, or do. I'm not your parent.
class Maybe
attr_reader :value
# @returns [Maybe]
def self.empty
@empty ||= new(nil)
end
def initialize(value, &block)
@value = value.is_a?(Maybe) ? value.value : value
@tylerjohnst
tylerjohnst / wait-for
Last active February 12, 2019 17:26
Ability have the shell wait until a script returns a non zero
#!/usr/bin/env ruby
require 'optparse'
options = {
retries: 10,
delay: 1
}
parser = OptionParser.new do |opts|
@tylerjohnst
tylerjohnst / gist:21ba9c17fe1ce5004889532b4c61d62c
Created February 19, 2019 15:59
node-alpine installation diff
C /usr
A /usr/include
A /usr/include/node
A /usr/include/node/node_buffer.h
A /usr/include/node/node_object_wrap.h
A /usr/include/node/uv
A /usr/include/node/uv/win.h
A /usr/include/node/uv/aix.h
A /usr/include/node/uv/android-ifaddrs.h
A /usr/include/node/uv/errno.h