This file contains 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
#!/usr/bin/env bash | |
QUERY=${1:-h/1} | |
elixir -e " | |
import IEx.Helpers | |
Application.put_env(:iex, :colors, [width: 80, enabled: true]) | |
h(${QUERY}) | |
" \ | |
| /usr/bin/less -R | |
This file contains 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
#!/usr/bin/env elixir | |
# similar to `while gets` | |
defmodule Helpers do | |
def chomp(string) do | |
String.trim_trailing(string, "\n") | |
end | |
def p(arg) do | |
inspect(arg, pretty: true) |
This file contains 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
#!/usr/bin/env elixir | |
# similar to `while gets` and prints line | |
defmodule Helpers do | |
def chomp(string) do | |
String.trim_trailing(string, "\n") | |
end | |
def p(arg) do | |
inspect(arg, pretty: true) |
CTRL-C
sendsINT
("interrupt") signal. Ignores input and creates a new prompt.CTRL-D
sendsEOT
("end of transmission") signal. Exits.CTRL-Z
sendsTSTP
("terminal stop") signal. Nothing.
This file contains 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
#!/usr/bin/env ruby | |
# (The MIT License) | |
# | |
# Copyright (c) 2015 Michael V. O'Brien | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
ember-data.js:https://github.com/emberjs/data/tree/0396411e39df96c8506de3182c81414c1d0eb981
In short, when there is an error, I want to display error messages in the view, and then the user can 1) cancel, which will rollback the transaction 2) correct the input errors and successfully commit the transaction, passing the validations on the server.
updateRecord: function(store, type, record) {
This file contains 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-option (alias: set) | |
# set-window-option (alias: setw) | |
# bind-key (alias: bind) | |
# unbind-key (alias: unbind) | |
################################################## | |
# prefix | |
set -g prefix M-` | |
unbind C-b |
This file contains 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
STACK_NAME='stack' | |
alias stack="redis-cli lrange ${STACK_NAME} 0 -1" | |
alias push="redis-cli lpush ${STACK_NAME}" | |
alias pop="redis-cli lpop ${STACK_NAME}" | |
alias empty="redis-cli del ${STACK_NAME}" |
This file contains 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
#!/usr/bin/env bash | |
export CHEF_DIR="${HOME}/cheftest" | |
rm -rf $CHEF_DIR/* | |
rm -rf $CHEF_DIR/.git* | |
mkdir -p "$CHEF_DIR" | |
sudo apt-get install ruby ruby-dev libopenssl-ruby rdoc ri irb build-essential wget ssl-cert git | |
cd /tmp |
NewerOlder