start new:
tmux
start new with session name:
tmux new -s myname
| ------------------ | |
| How to setup git based push to live webserver on windows with apache | |
| ------------------ | |
| 1) Install http://code.google.com/p/msysgit/ | |
| 2) Setup your git directories | |
| # Setup a base git directory | |
| mkdir c:/server/git | |
| git init --bare www.git |
| val factorial = (n) => { | |
| if(n < 2) 1 else (n * factorial(n - 1)); | |
| }; | |
| println("factorial(3) = " + factorial(3)); | |
| def mkcounter(n) = () => { | |
| n = n + 1; | |
| n | |
| }; | |
| val counter = mkcounter(6); |
| ### INSTALLATION NOTES ### | |
| # 1. Install Homebrew (https://github.com/mxcl/homebrew) | |
| # 2. brew install zsh | |
| # 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh) | |
| # 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace | |
| # 5. Install iTerm2 | |
| # 6. In iTerm2 preferences for your profile set: | |
| # Character Encoding: Unicode (UTF-8) | |
| # Report Terminal Type: xterm-256color | |
| # 7. Put itunesartist and itunestrack into PATH |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| package org.papasofokli | |
| import scala.util.parsing.combinator.JavaTokenParsers | |
| /** | |
| * <b-expression>::= <b-term> [<orop> <b-term>]* | |
| * <b-term> ::= <not-factor> [AND <not-factor>]* | |
| * <not-factor> ::= [NOT] <b-factor> | |
| * <b-factor> ::= <b-literal> | <b-variable> | (<b-expression>) | |
| */ |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| package gvl | |
| import grails.converters.JSON | |
| class ErrorController { | |
| // Forbidden | |
| def error403() { | |
| withFormat { | |
| html { render(view: 'error403') } |
| #Recommended minimum configuration: | |
| acl manager proto cache_object | |
| acl localhost src 127.0.0.1/32 | |
| acl to_localhost dst 127.0.0.0/8 | |
| acl localnet src 0.0.0.0/8 192.168.100.0/24 192.168.101.0/24 | |
| acl SSL_ports port 443 | |
| acl Safe_ports port 80 # http | |
| acl Safe_ports port 21 # ftp | |
| acl Safe_ports port 443 # https | |
| acl Safe_ports port 70 # gopher |
| DOMAIN CLASS (Post): | |
| String timeDay | |
| Date date | |
| static mapping = { | |
| timeDay formula: "FORMATDATETIME(date, 'yyyy-MM-dd')" // h2 sql | |
| //timeMonth formula: "DATE_FORMAT(time, '%Y-%m-%d')" // mysql sql | |
| } | |
| CONTROLLER: | |
| def c = Post.createCriteria() |