To enable full stack traces just add the command line argument -Dgrails.full.stacktrace=true
when calling grails
, e. g.:
grails -Dgrails.full.stacktrace=true run-app
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
# Shows little symbol '±' if you're currently at a git repo and '○' all other times | |
function prompt_char { | |
git branch >/dev/null 2>/dev/null && echo '±' && return | |
hg root >/dev/null 2>/dev/null && echo '☿' && return | |
echo '○' | |
} | |
PROMPT=' | |
%{$fg[blue]%}%n%{$reset_color%} on %{$fg[yellow]%}%m%{$reset_color%} in %{$fg[green]%}%~%b%{$reset_color%} $(hg_prompt_info)$(git_time_since_commit)$(check_git_prompt_info) | |
${vcs_info_msg_0_}$(prompt_char) ' |
#!/bin/bash | |
for dir in $(find . -name '.git' -type d) | |
do | |
dir=$(dirname $dir) | |
cd $dir | |
STATE="" | |
if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then |
upstream gitlab { | |
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket; | |
} | |
# This is a normal HTTP host which redirects all traffic to the HTTPS host. | |
# Replace git.example.com with your FQDN. | |
server { | |
listen *:80; | |
server_name gitlab.example.com gitlab; | |
server_tokens off; |
#!/bin/sh | |
echo Install all AppStore Apps at first! | |
# no solution to automate AppStore installs | |
read -p "Press any key to continue... " -n1 -s | |
echo '\n' | |
echo Install and Set San Francisco as System Font | |
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)" | |
echo Install Homebrew, Postgres, wget and cask | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" |
// Style 1 | |
// Export all manually | |
// Good: Calling functions inside the module is convenient | |
// Bad: module.exports becomes verbose and it's tedious to add new functions | |
function a() { | |
b() | |
} |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
(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.