Standard escape codes are prefixed with Escape
:
- Ctrl-Key:
^[
- Octal:
\033
- Unicode:
\u001b
- Hexadecimal:
\x1B
- Decimal:
27
curl https://api.telegram.org/bot/getUpdates | grep -Po '"from":{"id":.+?,'
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
This document is a collection of concepts and strategies to make large Elm projects modular and extensible.
We will start by thinking about the structure of signals in our program. Broadly speaking, your application state should live in one big foldp
. You will probably merge
a bunch of input signals into a single stream of updates. This sounds a bit crazy at first, but it is in the same ballpark as Om or Facebook's Flux. There are a couple major benefits to having a centralized home for your application state:
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/bin/bash | |
# Pull this file down, make it executable and run it with sudo | |
# wget https://gist.githubusercontent.com/bryanhunter/10380945/raw/build-erlang-17.0.sh | |
# chmod u+x build-erlang-17.0.sh | |
# sudo ./build-erlang-17.0.sh | |
if [ $(id -u) != "0" ]; then | |
echo "You must be the superuser to run this script" >&2 | |
exit 1 | |
fi |
class GroupersController < ApplicationController::Base | |
def create | |
@grouper = Grouper.new(leader: current_member) | |
if @grouper.save | |
confirm_grouper_via_emails(@grouper) | |
enqueue_bar_assignment(@grouper) | |
redirect_to home_path | |
else |
# will suspend on every function call (very proof of concept, | |
# it will be really easy to get access to local variables, a | |
# full stack, and even live evaluate within any closure) | |
% node test.out.js | |
[suspended] foo() | |
> c | |
[suspended] bar(x) | |
> c | |
[suspended] bar(i - 1) |
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
user ||= User.new # This is used for not logged user if you have a need for it | |
if User.current_role == 'admin' # From ApplicationController we can get current_role and check it up against the role we want. | |
can :manage, :all | |
else |