brew unlink crystal-lang
brew install <url to formula> # check more on appendix below
If you'd like to check for installed crystal versions, just run:
# Chapter 2: Designing Classes with Single Responsability | |
Single Responsability | |
* Ask Each Method: 'Class whats your :method?' | |
* Hide Instance Variables | |
* Hide Data Structures | |
* Extract Extra Responsability From Methods | |
Dependencies | |
* Must known no Constant | |
* Must _not_ call methods on other objects (constants) |
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
# | |
# This file was generated by Bundler. | |
# | |
# The application 'blade' is installed as part of a gem, and | |
# this file is here to facilitate running it. | |
# | |
# Put this file on bin/blade |
QUnit.config.hidepassed = false; | |
var timeout = QUnit.config.testTimeout; | |
console.log(timeout); | |
QUnit.config.testTimeout = 10000; | |
QUnit.test( "VirtualMachines#index", function( assert ) { | |
assert.expect( 2 ); | |
var done = assert.async(2); | |
assert.equal( sum(1, 1), 2, "Passed!" ); |
$ trailblazer generate operation Thing::Create | |
class Thing::Create < Trailblazer::Operation | |
end | |
$ trailblazer generate operation Thing::Create --steps | |
class Thing::Create < Trailblazer::Operation | |
step Model( Song, :new ) | |
step :assign_current_user! | |
end |
xcode-select --install | |
brew install \ | |
bdw-gc \ | |
gmp \ | |
libevent \ | |
libpcl \ | |
libxml2 \ | |
libyaml \ | |
llvm | |
git clone https://github.com/crystal-lang/crystal.git |
require 'trailblazer/endpoint' | |
require 'trailblazer/endpoint/app_matcher' | |
class Api::Controller < ApplicationController | |
protect_from_forgery with: :null_session | |
protected | |
def default_handler | |
->(m) do |
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import PropTypes from 'prop-types' | |
import styled, {ThemeProvider} from 'styled-components'; | |
const Button = styled.button` | |
font-size: 1em; | |
margin: 1em; | |
padding: 0.25em 1em; | |
border-radius: 3px; |
import test from 'ava' | |
import fs from 'fs' | |
import mock from 'mock-fs' | |
test.before(t => { | |
mock({ | |
'dir': { | |
'document': 'mocked content' | |
} | |
}) |