Skip to content

Instantly share code, notes, and snippets.

require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "activerecord", require: "active_record"
gem "activejob", require: "active_job"
gem "sqlite3"
gem "searchkick", git: "https://github.com/ankane/searchkick.git"
end
@itsmikeq
itsmikeq / db_fixtures_dump.rake
Last active July 8, 2020 15:26 — forked from ecleel/db_fixtures_dump.rake
Rails 5: Dump Rails db to fixtures
# frozen_string_literal: true
# Original from http://snippets.dzone.com/posts/show/4468 by MichaelBoutros
#
# Optimized version which uses to_yaml for content creation and checks
# that models are ActiveRecord::Base models before trying to fetch
# them from database.
namespace :db do
namespace :fixtures do
desc "Dumps all models into fixtures."
@itsmikeq
itsmikeq / inputrc
Created August 12, 2017 18:18
mikes inputrc
# /etc/inputrc - global inputrc for libreadline
# See readline(3readline) and `info rluserman' for more information.
# Be 8 bit clean.
set input-meta on
set output-meta on
# To allow the use of 8bit-characters like the german umlauts, uncomment
# the line below. However this makes the meta key not work as a meta key,
# which is annoying to those which don't need to type in 8-bit characters.
#include <iostream>
#include <unistd.h>
#include <csignal>
#include <sys/select.h>
using namespace std;
void signalHandler( int signum ) {
cout << "Interrupt signal (" << signum << ") received.\n";
@itsmikeq
itsmikeq / rdd.md
Last active February 13, 2018 00:28
Resume Driven Development

Rooster Teeth Development

Requirements

  • Use React
  • Utilize Redux or similar store
  • Feel free to use any CSS frameworks you wish (eg bootstrap)
  • Please post your answers to a JSBin
  • Don't take longer than an hour or two to code this
  • Be prepared to talk through your code
  • Have fun with it and feel free to be creative
[
{
"name": "The #1 Show",
"summary": "<p>The <a href=\"http://staging.screwattack.com/community/tags/1\">#1</a> Show is a show about everything... except video games. We have enough shows for that. A show that was conceived after arguing while in a backyard pool over the best cereals, this is the end result... but is still a work in progress.</p>",
"seasons": [
{
"slug": "the-1-show-season",
"title": "",
"show_episodes": [
{

Thanks for taking the time to take our Fullscreen code challenge!

Please post your answers to a JSBin within a week of receiving this test. Feel free to use whichever compiled-to-JS language you want (Coffeescript, ES6/Babel, vanilla Javascript, etc..), but be prepared to explain what your code compiles down to in plain ol' Javascript if you do.

Getting classy.

  • Create a Vehicle class with getName and setName methods which manipulate a name property on its class instances.
  • Write a getter/setter for wheels and seats using the get/set keywords if your language of choice supports them (pro-tip: it probably does).
  • Create Car and Motorcycle classes which extend from Vehicle and set the number of seats/wheels appropriately.
  • Instances should be properly inherit from your class, so myCarInstance instanceof Car should return true.
@itsmikeq
itsmikeq / inputrc
Created January 29, 2016 00:06
My inputrc file
# /etc/inputrc - global inputrc for libreadline
# See readline(3readline) and `info rluserman' for more information.
# Be 8 bit clean.
set input-meta on
set output-meta on
# To allow the use of 8bit-characters like the german umlauts, uncomment
# the line below. However this makes the meta key not work as a meta key,
# which is annoying to those which don't need to type in 8-bit characters.
@itsmikeq
itsmikeq / url_encoder_patch.rb
Last active November 11, 2015 22:44
fix %2F's in rails > 4.1.2
# Fix routes with /'s that are switched to %2F in > rails 4.1.1
# put in config/initializers/
module ActionDispatch
module Journey
class Router
class Utils
class UriEncoder
def escape_segment(segment)
# dont jack up URLs and turn the /'s into %2F's
URI.decode(escape(segment, SEGMENT))