https://mattbrictson.com/nginx-reverse-proxy-cache
https://www.nginx.com/resources/wiki/start/topics/examples/full/
require 'benchmark/ips' | |
require 'faraday' | |
require 'excon' | |
require 'typhoeus'#, '~> 0.3.3' | |
require 'patron' | |
require 'net-http-persistent' | |
default_adapter = Faraday.new(:url => 'http://localhost') do |faraday| | |
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP | |
end |
$tail -100f /var/log/applications/application.log | awk ' | |
/INFO/ {print "\033[32m" $0 "\033[39m"} | |
/Exception/ {print "\033[31m" $0 "\033[39m"} | |
' |
{ title: "My ER Diagram" } | |
# Tables | |
[User] { color: :blue } | |
*id | |
blog_id* <nullable> | |
name | |
[Blog] { color: :orange } | |
*id |
(function() { | |
var buttons = { | |
next: $('button.next') | |
}; | |
buttons.next.addEventListener('click', function() { | |
lifeView.next(); | |
}); |
#!/usr/bin/env ruby | |
# require 'bundler/setup' | |
# Bundler.require(:default) | |
module F | |
ZERO = -> p { -> x { x } } | |
ONE = -> p { -> x { p[x] } } | |
TWO = -> p { -> x { p[p[x]] } } |
#!/bin/bash | |
cd ~/projects/ | |
echo -en '\033]2;'$1'\007' # set the title of the window | |
case "$1" in | |
wubytes) cd wubytes && foreman start;; | |
kiwitime) cd kiwitime && rails s -p 5000;; |
require "pp" | |
block_size = 4_096 | |
def tags_from_file(filename) | |
no_tag_or_tag = /([^<>]+)|(<\/[^<>]+>)|(<[^<>]+?\/>)|(<\!\[CDATA\[(?:.*?)\]\]>)|(<[^!a-zA-Z][^<>]+>)|(<[^<>]+>)/ | |
reg_exp = /\A(?<p>(?:#{no_tag_or_tag}))*\g<p>*/ | |
block_size = 4_096 | |
Enumerator.new do |enum| |
callable
: something that can be called with params; like a function, method, procedure, macro...Point:
: 2d tuple/list/array or object/struct with coordinates (x, y) as attributes/fieldsRegion
: a callable that receive a point and return true
if is inside of a a region, and false
if is out.Distance
: a floaterror_page 500 /500.html; | |
location /500.html{ | |
return 500 '{"error": {"status_code": 500,"status": "Internal Server Error"}}'; | |
} | |
error_page 502 /502.html; | |
location /502.html{ | |
return 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}'; | |
} |