This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Minimal CORS config for nginx | |
# | |
# A modification of https://gist.github.com/alexjs/4165271 | |
# | |
# NB: This relies on the use of the 'Origin' HTTP Header. | |
location /static { | |
if ($http_origin ~* (whitelist\.address\.one|whitelist\.address\.two)$) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
THIS_FOLDER=`dirname $0` | |
node=$1 | |
# What files have changed | |
files=`hg log --template="{files}" -r $node` | |
# Check each | |
for file in $files; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the solution | |
// 1. declare the class Number(Int) | |
// 2. define method Number.inc(): Number | |
// 3. define method Number.dec(): Number | |
// 4. define getNumber():Int | |
class Number(val n : Int) { // n cannot be changed! | |
def inc(): Number = new Number(n + 1) |