Skip to content

Instantly share code, notes, and snippets.

View Anonyfox's full-sized avatar
🦀
Gopher, Rustacean & Alchemist

Maximilian Stroh Anonyfox

🦀
Gopher, Rustacean & Alchemist
View GitHub Profile
@Anonyfox
Anonyfox / The Technical Interview Cheat Sheet.md
Last active August 26, 2015 13:23 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@Anonyfox
Anonyfox / tinytest.api
Last active August 29, 2015 14:18 — forked from stbaer/tinytest.api
test.isFalse(v, msg)
test.isTrue(v, msg)
test.equal(actual, expected, message, not)
test.length(obj, len)
test.include(s, v)
test.isNaN(v, msg)
test.isUndefined(v, msg)
test.isNotNull
test.isNull
test.throws(func)
defmodule Microsites.Compile do
import File
def directory(folder \\ "elixir-lang.info") do
folder
|> reset_destination_folder
|> copy_assets
|> create_metadata
|> read_content_files
|> create_html_files
@Anonyfox
Anonyfox / example_controller_test.exs
Created October 22, 2015 20:40
Pattern how to test a controller that needs a logged-in user in phoenix. Follows the example code written in https://pragprog.com/book/phoenix/programming-phoenix
defmodule N3ws.ChannelControllerTest do
import Plug.Conn, only: [assign: 3]
@valid_attrs %{name: "some content"}
@invalid_attrs %{}
@user_attrs %{
email: "some content",
name: "some content",
password_virtual: "some content"
}
# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:
@Anonyfox
Anonyfox / sqlite_in_memory.rb
Created January 8, 2013 11:55
Trying to get activerecord use sqlite3's shared_cache
# encoding: utf-8
require "active_record"
#require "activerecord-jdbcsqlite3-adapter" # gem install this, but not require
require 'activerecord-jdbc-adapter'
# a very basic migration
class CreateSamplesTable < ActiveRecord::Migration
def change
create_table :samples do |t|
@Anonyfox
Anonyfox / gist:4483617
Created January 8, 2013 13:01
Doesn't work on Windows 7, but on Ubuntu 12.04 and ArchLinux. OpenJDK 7 and Oracle JDK 7. Latest JRuby and Gems.
# encoding: utf-8
require "active_record"
#require "activerecord-jdbcsqlite3-adapter" # gem install this, but not require
require 'activerecord-jdbc-adapter'
# a very basic migration
class CreateSamplesTable < ActiveRecord::Migration
def change
create_table :samples do |t|
C:\Users\Fox\Dropbox\projects\NewsFisher\Concept>jruby sqlite_in_memory.rb
ActiveRecord::JDBCError: The driver encountered an unknown error: opening db: ':memory:?cache=shared': Die Syntax f³r den Dateinamen, Verzeichnisnamen oder die Datentrõgerbezeichnung ist falsch
initialize at c:/jruby-1.7.2/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.2.5/lib/arjdbc/jdbc/connection.rb:88
initialize at c:/jruby-1.7.2/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.2.5/lib/arjdbc/jdbc/adapter.rb:31
jdbc_connection at c:/jruby-1.7.2/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.2.5/lib/arjdbc/jdbc/connection_methods.rb:6
sqlite3_connection at c:/jruby-1.7.2/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.2.5/lib/arjdbc/sqlite3/connection_methods.rb:17
__send__ at org/jruby/RubyBasicObject.java:1665
send at org/jruby/RubyKernel.java:2090
get '/test.gif' do
content_type 'image/gif'
"GIF89a\1\0\1\0%c\0\0%c%c%c\0\0\0,\0\0\0\0\1\0\1\0\0%c%c%c\1\0;" % [144, 153, 0, 0, 2, 2, 4]
end