I like Pages.app, but don't want to deal with constantly copying and pasting code around.
Here is how I do syntax highlighting in Pages.app by pressing a key command. It's based off of this post on stack exchange.
sudo easy_install Pygments
If: | |
- you add and commit with the wrong email address in git, and | |
- your remote has a hook set up to prevent you from pushing with the bad address | |
Then you need to amend the author of your commit before push can succeed: | |
1. fix your email address in git config: | |
$ git config user.name "Your Name" |
I like Pages.app, but don't want to deal with constantly copying and pasting code around.
Here is how I do syntax highlighting in Pages.app by pressing a key command. It's based off of this post on stack exchange.
sudo easy_install Pygments
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)(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.
// | |
// Created by Dima Vartanian on 10/29/15. | |
// | |
import Foundation | |
import Crashlytics | |
// this method gives us pretty much the same functionality as the CLS_LOG macro, but written as a Swift function, the only differences are that we have to use array syntax for the argument list and that we don't get see if the method being called is a class method or an instance method. We also have to define the DEBUG compiler flag with -D DEBUG. | |
/// Usage: | |
/// |
A common task when developing iOS apps is to register custom cell subclasses for both UITableView
and UICollectionView
. Well, that is if you don’t use Storyboards, of course.
Both UITableView
and UICollectionView
offer a similar API to register custom cell classes:
public func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
public func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)
postgres: | |
image: postgres:9.4 | |
volumes: | |
- ./init.sql:/docker-entrypoint-initdb.d/init.sql |
#!/bin/bash | |
for f in `ls *.gyb` | |
do | |
echo "Processing $f" | |
name=${f%.gyb} | |
../../../utils/gyb -D CMAKE_SIZEOF_VOID_P=8 -o $name $f --line-directive "" | |
done |