Skip to content

Instantly share code, notes, and snippets.

View daniel-marschner's full-sized avatar

Daniel Marschner daniel-marschner

  • Wunderlist
  • Berlin
View GitHub Profile
@daniel-marschner
daniel-marschner / cors-nginx.conf
Created December 10, 2012 09:33 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@daniel-marschner
daniel-marschner / gist:4001503
Created November 2, 2012 13:57
Checks if the given domain is reachable as long as there is a 200 OK coming back. Super simple! ;)
require 'net/http'
require 'date'
# Fetches the first argument passed to the script, if no is given
# it raises and error with this simple custom message.
unless @domain = ARGV.first
raise "You need to pass in a domain like www.6wunderkinder.com"
end
puts "[#{DateTime.now}] Started the DNS check for #{@domain}..."
@daniel-marschner
daniel-marschner / gist:4001390
Created November 2, 2012 13:33
Colored GIT prompt
# Setting GIT prompt
c_cyan=`tput setaf 6`
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_sgr0=`tput sgr0`
branch_color () {
if git rev-parse --git-dir >/dev/null 2>&1
then
color=""