- https://www.docker.com/toolbox
docker-machine create --driver virtualbox dev
docker-machine env dev
(add values to~/.zshrc
)- e.g.
echo eval "$(docker-machine env dev)" >> ~/.zshrc
- e.g.
docker-machine ls
docker ps
(might need to re-source.zshrc
file; e.g.. ~/.zshrc
)docker run hello-world
docker-machine ip dev
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 React, { Component } from 'react' | |
import { Field, reduxForm } from 'redux-form' | |
import { userLogin } from '../../actions' | |
import './index.css' | |
class Login extends Component { | |
componentWillMount (){ | |
document.body.classList.add('login'); |
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
set -g mode-mouse on | |
set -g mouse-resize-pane on | |
set -g mouse-select-pane on | |
set -g mouse-select-window on | |
set -g prefix C-a | |
unbind C-b | |
bind C-a send-prefix | |
# force a reload of the config file | |
unbind r |
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
class Invoice | |
def process_payment | |
# In this manner, it abstracts the logic of payment processing to the service object | |
InvoiceServices::Payment.new(self).process | |
end | |
end | |
class Tracker | |
def self.track | |
# Do tracking stuff here |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
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
# Original source: http://hashrocket.com/blog/posts/bridging-activerecord-and-mongoid | |
class ActiveRecord::Base | |
def self.has_many_documents(association_name) | |
class_eval %< | |
def #{association_name} | |
#{association_name.to_s.singularize.classify}.where(#{name.underscore}_id: id) | |
end | |
> | |
end |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#define SUIT_MAX_VAL 4 | |
#define NUM_MAX_VAL 13 | |
#define BLACK_JACK_NUM 21 | |
char deck[4][13]; |
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
{ | |
// Here you can provide your own command line | |
// which is used to run rubocop. The path will be | |
// replaced by the file or folder which needs | |
// to be checked. | |
// | |
// If check_for_rvm or check_for_rbenv is enabled, | |
// it will be prefixed with a call to rvm or rbenv. | |
// If none of them are enabled, the command will be | |
// executed without any additions. |
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
{ | |
"erb_verify_command": "erb -xT - {file_name} | ruby -c", | |
"ruby_verify_command": "ruby -c {file_name}", | |
"run_ruby_unit_command": "ruby -Itest {relative_path}", | |
"run_single_ruby_unit_command": "ruby -Itest {relative_path} -n '{test_name}'", | |
"run_cucumber_command": "zeus cucumber {relative_path} --no-color", | |
"run_single_cucumber_command": "zeus cucumber {relative_path}:{line_number} --no-color", |