Skip to content

Instantly share code, notes, and snippets.

@RJNY
RJNY / index.html
Last active February 1, 2018 04:58
Seth Beebe
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>New Leaf Design</title>

Section 1

The following questions are your technical evaluation. Your target audience is a senior developer. Demonstrate your understanding. Keep your answer concise. Try to keep answers within one to two paragraphs.

Questions

What does a doctype do?

doctype is an HTML element (not a tag). It's used to declare what kind of HTML is used in the document. They are required for legacy reasons. Without it, some browsers will enter quirks mode and

@RJNY
RJNY / larp.rb
Created February 10, 2017 19:19
code-sample-3
class LayoutAndRowPosition < ActiveRecord::Base
default_scope { order('position') }
belongs_to :layout
belongs_to :row
acts_as_list scope: :layout
end
@RJNY
RJNY / images.rb
Created February 10, 2017 19:16
code-sample-2
##################################################
##### app/models/piece.rb #####
##################################################
class Piece < ApplicationRecord
belongs_to :category
has_many :tags, as: :taggable
has_many :images, as: :imageable, dependent: :destroy
accepts_nested_attributes_for :images
@RJNY
RJNY / address.rb
Created February 10, 2017 19:15
code-sample-1
class Address < ActiveRecord::Base
include SmartyStreets
belongs_to :user
before_save :trim_zip_code, :activate
validates :line1, :zip_code, :user_id, presence: true
validate :validate_address
validates :city, :state, presence: true
after_commit :ensure_one_active_address, :update_user_location
@RJNY
RJNY / React Vim Snippets
Created December 16, 2016 22:32
React Vim Snippets
#
# React snippets
#
snippet rnccf
import React, { PropTypes } from 'react'
import { View, StyleSheet, Text } from 'react-native'
$1.propTypes = {
@RJNY
RJNY / Preferences.sublime-settings
Last active September 17, 2015 18:34
sublime_defaults
{
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night-Eighties.tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_face": "inconsolata",
"font_size": 19,
"ignored_packages":
[
"Vintage",
"Markdown"
],
@RJNY
RJNY / .bash_profile
Last active August 29, 2015 14:24
OSX_Bash_template
# Awesome website for shell scripts: http://explainshell.com/
export PATH=/usr/local/bin:$PATH
### Look at http://alias.sh/ for more fun things like this
# For ruby development
which -s bundle && alias be="bundle exec"
# Some tests with git common commands
alias be='bundle exec'
@RJNY
RJNY / learn.rb
Created February 28, 2015 23:00
recursion.rb
def recursion(arg, arg2=[]) #5
arg2 << arg
p arg2
if arg <= 0 #false
puts "arg: #{arg}, finished" #no
return
end
puts "before: #{arg}" # before: 5
recursion(arg-1, arg2) # recursion(4) ...brb
puts "after: #{arg}" #5
@RJNY
RJNY / BCrypt_cheatsheet.rb
Last active August 29, 2015 14:02
BCrypt cheat sheet
# BCrypt Outline
# Config/Environment
require 'bcrypt'
# Gemfile
gem "bcrypt"
# Migration
t.string :password_hash, null: false