start new:
tmux
start new with session name:
tmux new -s myname
SELECT email_address, COUNT(email_address) AS occurrences | |
FROM users | |
GROUP BY email_address | |
HAVING occurrences > 1 |
# Call virtualenvwrapper's "workon" if .venv exists. This is modified from-- | |
# http://justinlilly.com/python/virtualenv_wrapper_helper.html | |
# which is linked from-- | |
# http://virtualenvwrapper.readthedocs.org/en/latest/tips.html#automatically-run-workon-when-entering-a-directory | |
check_virtualenv() { | |
if [ -e .venv ]; then | |
env=`cat .venv` | |
if [ "$env" != "${VIRTUAL_ENV##*/}" ]; then | |
echo "Found .venv in directory. Calling: workon ${env}" | |
workon $env |
#!/usr/bin/env bash | |
mkdir vim | |
curl https://s3.amazonaws.com/heroku-vim/vim-7.3.tar.gz --location --silent | tar xz -C vim | |
export PATH=$PATH:/app/vim/bin |
class Table(Base): | |
id = Column(Integer, primary_key=True) | |
_name = Column('name', String(24)) | |
@property | |
def name(self): | |
return self._name; | |
@name.setter | |
def name(self, value): |
# Call virtualenvwrapper's "workon" if .venv exists. This is modified from-- | |
# http://justinlilly.com/python/virtualenv_wrapper_helper.html | |
# which is linked from-- | |
# http://virtualenvwrapper.readthedocs.org/en/latest/tips.html#automatically-run-workon-when-entering-a-directory | |
check_virtualenv() { | |
if [ -e .venv ]; then | |
env=`cat .venv` | |
echo "Found .venv in directory. Calling: workon ${env}" | |
workon $env | |
fi |
import json | |
import sqlalchemy.types | |
class JSONType(sqlalchemy.types.PickleType): | |
"""An example | |
>>> class User(declarative_base): | |
... friends = Column(JSONType()) | |
... |
-- Maps each element to a 1, then sums up all the elements | |
len :: [a] -> Integer | |
len = sum . map (\_ -> 1) | |
-- Adds up all the heads (recursively) until the list is empty | |
len' :: [a] -> Integer | |
len' [] = 0 | |
len' (_:xs) = 1 + len' xs | |
-- Extract into a fold using this technique: [ [] := v, (:) := f ] |
/** | |
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units | |
* | |
* To overcome this, create media queries that target the width, height, and orientation of iOS devices. | |
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing | |
* the height of element `.foo` —which is a full width and height cover image. | |
* | |
* iOS Resolution Quick Reference: http://www.iosres.com/ | |
*/ | |