Skip to content

Instantly share code, notes, and snippets.

set nocompatible
set autowrite
filetype off
set rtp+=~/dotfiles/vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-fugitive'
class QueueItem < ActiveRecord::Base
belongs_to :video
belongs_to :user
validates_uniqueness_of :video_id, scope: :user_id
validates_numericality_of :position, { only_integer: true }
delegate :title, to: :video, prefix: true
delegate :category, to: :video
def category_name
category.name if category
@zmackie
zmackie / gist:2ca57c41c6f9ce3c80e6
Created March 19, 2015 20:52
FactoryGirl Error
-- initialize_schema_migrations_table()
-> 0.0050s
rake aborted!
FactoryGirl::DuplicateDefinitionError: Factory already registered: item
/Users/zanderm/.rvm/gems/ruby-2.1.2/gems/factory_girl-4.4.0/lib/factory_girl/decorator.rb:10:in `method_missing'
/Users/zanderm/.rvm/gems/ruby-2.1.2/gems/factory_girl-4.4.0/lib/factory_girl/decorator/disallows_duplicates_registry.rb:6:in `register'
/Users/zanderm/.rvm/gems/ruby-2.1.2/gems/factory_girl-4.4.0/lib/factory_girl.rb:85:in `block in register_factory'
/Users/zanderm/.rvm/gems/ruby-2.1.2/gems/factory_girl-4.4.0/lib/factory_girl.rb:84:in `each'
/Users/zanderm/.rvm/gems/ruby-2.1.2/gems/factory_girl-4.4.0/lib/factory_girl.rb:84:in `register_factory'
/Users/zanderm/.rvm/gems/ruby-2.1.2/gems/factory_girl-4.4.0/lib/factory_girl/syntax/default.rb:20:in `factory'
@zmackie
zmackie / index.js
Created November 8, 2015 22:28
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the righ
var request = require('request')
request
.get('https://api.github.com/users/octocat/orgs')
.on('response', function(response) {
console.log(response.statusCode) // 200
console.log(response.headers['content-type']) // 'image/png'
I've been interviewing for JS positions over the past few months and have noticed the same questions pop up in the technical parts of the interview. There have been similar posts to this but I really received a benefit from them and thought I'd echo my experience. Two of these "interviews" were online assessments, two were in person, and two were over Skype. The positions I've applied for are mainly at start ups and not for any specified Jr / Mid / Sr level.
I know that a lot of people disagree with this type of interview, like them or not, in my experience they've been a reality. When you're self-taught and haven't had your first job, I guess you have to prove yourself somehow. An assessment of Github / portfolio links would be a more ideal measure of progress but doesn't seem to count for everything.
The good news: These were the hardest questions. More good news - everyone was completely chill in the times when I got stuck (of these questions, I got flustered on both the event loop + Pascal's triangle),

Keybase proof

I hereby claim:

  • I am zanadar on github.
  • I am zanadar (https://keybase.io/zanadar) on keybase.
  • I have a public key ASCQ65P1DDaLCnUJ8r2FLarT8Yr6j5V-MQmbhpqacIbZAAo

To claim this, I am signing this object:

@zmackie
zmackie / OSS.club.md
Last active February 22, 2017 14:23
Open Source Club

2/21 Meeting

Worked:
Didn't work:
How we can make it easier to contribute:
@zmackie
zmackie / sorts.c
Last active February 25, 2017 21:39
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
void die(const char *message)
{
if (errno) {
perror(message);
} else {
@zmackie
zmackie / client.go
Created November 18, 2017 14:29 — forked from elico/client.go
golang tcp client connection alive check
package main
import (
"fmt"
"io"
"net"
"time"
)
func main() {