This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# colored console output | |
require 'colorize' | |
class MyClass | |
end | |
def attempt(message) | |
begin | |
puts message + ": " + yield.green | |
rescue => e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www= | |
.w3.org/TR/REC-html40/loose.dtd"> | |
<html xmlns=3D"http://www.w3.org/1999/xhtml"> | |
<head> | |
<header style=3D"background:#333;color:white;padding:40px"> | |
<div class=3D"shell" style=3D"margin:0 auto;max-width:800px"> | |
<h1> | |
Confirm Your Email |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveModel | |
class Serializer | |
module Utils | |
class UtilsTest < MiniTest::Test | |
def test_include_options_to_hash_from_symbol | |
expected = { author: {} } | |
input = :author | |
actual = ActiveModel::Serializer::Utils.include_options_to_hash(input) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_model' | |
require 'active_model_serializers' | |
class BaseModel | |
# provides self.model_name | |
include ActiveModel::Model | |
attr_accessor :id, :updated_at | |
def cache_key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num_sorted = 0 | |
num_total = 1000000 | |
num_elements = 10 | |
max_random_integer = num_elements | |
sorted = [] | |
num_total.times do |i| | |
array = Array.new(num_elements){ rand(max_random_integer) } | |
if array == array.sort | |
num_sorted += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First remove *all* keybindings | |
unbind-key -a | |
# Now reinsert all the regular tmux keys | |
# bind-key C-b send-prefix | |
bind-key C-o rotate-window | |
bind-key C-z suspend-client | |
bind-key Space next-layout | |
bind-key ! break-pane |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
resetToken: null | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import DS from 'ember-data'; | |
export default DS.JSONAPIAdapter.extend({ | |
namespace: 'api', | |
host: 'https://aeonvera-staging.work/' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import log from '../utils/log'; | |
import Post from '../models/post'; | |
export default Ember.Route.extend({ | |
model() { | |
return new Post({ | |
title: 'So Classy!', | |
author: 'Robert' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
user: null, | |
messenger: Ember.inject.service(), | |
message: '', | |
displayName: Ember.computed( | |
'user.title', 'user.firstName', 'user.lastName', function() { |