Skip to content

Instantly share code, notes, and snippets.

View totallymike's full-sized avatar

Michael Westbom totallymike

View GitHub Profile
@totallymike
totallymike / Description.md
Last active May 16, 2020 18:24 — forked from TejasQ/Description.md
⬢ G2i NodeJS Test

⬢ G2i NodeJS Test

Messaging acronyms are everywhere now. Do you know all of them?

Build a REST API for the World Texting Foundation, also known as WTF.

A sample JSON data file will be provided with a base set of acronym definitions. We expect you to create a NodeJS server using modern best practices for API development. Please consider the recommendations attached as this will list the items we are looking for above.

@totallymike
totallymike / machine.js
Last active April 29, 2020 14:06
Generated by XState Viz: https://xstate.js.org/viz
console.dir(actions);
const StepMachine = (
validateFunction = (obj) => Promise.resolve(obj)
) =>
Machine({
context: {
validate: validateFunction,
data: {},
},
package com.pretend.myforklift
import com.liyaos.forklift.slick.{ SlickCodegen, SlickMigrationCommandLineTool, SlickMigrationCommands, SlickMigrationManager }
import scala.io.StdIn
trait MyMigrationCommands extends SlickMigrationCommands
with MyMigrationFilesHandler {
this: SlickMigrationManager with SlickCodegen =>
@totallymike
totallymike / keybase.md
Created February 8, 2016 21:21
keybase.md

Keybase proof

I hereby claim:

  • I am totallymike on github.
  • I am totallymike (https://keybase.io/totallymike) on keybase.
  • I have a public key whose fingerprint is 2605 7D7A BEFD F7EC 8E03 4271 093C A226 E362 4CE1

To claim this, I am signing this object:

num calls time self name
-----------------------------------------------------------------------------------
1) 1 384.85 384.85 69.98% 384.75 384.75 69.96% nvm_die_on_prefix
2) 1 548.11 548.11 99.67% 89.53 89.53 16.28% nvm
3) 1 73.61 73.61 13.39% 73.61 73.61 13.39% nvm_ensure_version_installed
4) 1 1.69 1.69 0.31% 1.69 1.69 0.31% nvm_supports_source_options
5) 3 0.31 0.10 0.06% 0.31 0.10 0.06% nvm_has
6) 1 0.02 0.02 0.00% 0.02 0.02 0.00% nvm_is_iojs_version
-----------------------------------------------------------------------------------
@totallymike
totallymike / nginx.sh
Last active December 21, 2015 02:49 — forked from squarism/nginx.sh
#!/bin/bash
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
class User < ActiveRecord::Base
attr_accessible :role_id, :as => :admin
belongs_to :role
end
class Role < ActiveRecord::Base
has_many :users
end
class UsersController < ApplicationController
Rack::File headers parameter replaces cache_control after Rack 1.5.
.F
Failures:
1) CategoriesController POST create role authorization prevents non-administrators from creating new categories
Failure/Error: let (:user) { users(:miketheboss) }
ActiveRecord::RecordNotFound:
Couldn't find User with id=702598363
# ./spec/controllers/categories_controller_spec.rb:15:in `block (3 levels) in <top (required)>'
@totallymike
totallymike / buttheydont.rb
Created October 31, 2012 02:00
How I want these doubles to work
class Foo
attr_reader :stuff
def initialize(stuff)
@stuff = stuff
end
def bar
sock = TCPSocket.new('127.0.0.1', 1337)
stuff.each do |thing|
# input(a string) prints the string as the prompt, then listens to stdin
# int() converts strings (what you get from stdin) to integers
age = int( input("Enter your age: ") )
if age > 64:
print("You're old")
elif age > 17:
print("You can vote!")
else: