Let's say you want to host domains first.com
and second.com
.
Create folders for their files:
PROMPT="$PROMPT \ | |
%{$terminfo[bold]$fg[red]%}β %{$reset_color%}" |
defmodule PubSubServer do | |
def start(subscriber_callback \\ nil) do | |
spawn(__MODULE__, :run, [[ ], subscriber_callback]) | |
end | |
def subscribe(server, handler) do | |
send(server, {:subscribe, self}) | |
listen(handler) | |
end |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | π :tada: |
Version tag | π :bookmark: |
New feature | β¨ :sparkles: |
Bugfix | π :bug: |
require 'benchmark/ips' | |
require 'active_model' | |
require 'virtus' | |
require 'dry-validation' | |
require 'dry/validation/schema/form' | |
class User | |
include ActiveModel::Validations | |
include Virtus.model |
This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).
Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.
Switch to the master branch and make sure you are up to date:
defmodule MyApp do | |
use Application | |
def start(_type, _args) do | |
import Supervisor.Spec, warn: false | |
children = [ | |
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [ | |
dispatch: dispatch | |
]) |
" Throw me in your ~/.gvimrc | |
let g:squinty = 0 | |
function! Squint() | |
let windowBounds = system("osascript -e 'tell application \"MacVim\" to get bounds of window 1'")[:-2] | |
if g:squinty | |
set guifont=InputMonoCondensed_Thin:h14 | |
let g:squinty = 0 | |
else | |
set guifont=BLOKK:h6 |
Using WebSockets, React and Reflux together can be a beautiful thing, but the intial setup can be a bit of a pain. The below examples attempt to offer one (arguably enjoyable) way to use these tools together.
This trifect works well if you think of things like so:
this.state
in react should instead live within stores. Stores can listen to other stores as well as to events being fired.test/coverage/ |