start new:
tmux
start new with session name:
tmux new -s myname
#!/bin/sh | |
# http://sourceforge.net/projects/phpstylist/ | |
php=`which php` | |
stylist="/path/to/phpStylist.php" | |
$php $stylist "$@" \ | |
--indent_size 4 \ | |
--line_before_comment_multi \ |
_.mixin({ | |
// Get/set the value of a nested property | |
deep: function (obj, key, value) { | |
var keys = key.replace(/\[(["']?)([^\1]+?)\1?\]/g, '.$2').replace(/^\./, '').split('.'), | |
root, | |
i = 0, | |
n = keys.length; |
#!/bin/bash | |
# __ | |
# _____ ____ _/ |_ ____ ____ _______ | |
# / \ _/ __ \ \ __\_/ __ \ / _ \ \_ __ \ | |
# | Y Y \\ ___/ | | \ ___/ ( <_> ) | | \/ | |
# |__|_| / \___ > |__| \___ > \____/ |__| | |
# \/ \/ \/ | |
# | |
# .___ | |
# __| _/ __ __ _____ ______ |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)defmodule Config do | |
@moduledoc """ | |
This module handles fetching values from the config with some additional niceties | |
""" | |
@doc """ | |
Fetches a value from the config, or from the environment if {:system, "VAR"} | |
is provided. | |
An optional default value can be provided if desired. |
in OS X 10.4 to macOS sierra 10.12 and maybe higher!
Copy this entire code block and paste it into your terminal and push Return to create this file for you with correct permissions. It will (probably) ask for your password:
If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8
To use the new phx.new
project generator, you can install the archive with the following command:
$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez
Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs
:
this is example code for bvaughn/react-virtualized#147 (comment)
disclaimer: I simplified the code and renamed things, so I might have totally broken it, or omitted crucial css.
class Spreadsheet extends React.Component {
render () {
let rowCount = this.props.rows.length;
let columnCount = this.props.columns.length;
let width = CELL_WIDTH * columnCount;