URL: http://teamcity:8111/httpAuth/app/rest/projects/
Method: POST
Accept: application/xml
#See: http://daringfireball.net/2010/07/improved_regex_for_matching_urls | |
import re, urllib | |
GRUBER_URLINTEXT_PAT = re.compile(ur'(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))') | |
for line in urllib.urlopen("http://daringfireball.net/misc/2010/07/url-matching-regex-test-data.text"): | |
print [ mgroups[0] for mgroups in GRUBER_URLINTEXT_PAT.findall(line) ] | |
# The following command works for downloading when using Git for Windows: | |
# curl -LOf http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore | |
# | |
# Download this file using PowerShell v3 under Windows with the following comand: | |
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore | |
# | |
# or wget: | |
# wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore | |
# User-specific files |
/** | |
Returns a bounding rect for _el_ with absolute coordinates corrected for | |
scroll positions. | |
The native `getBoundingClientRect()` returns coordinates for an element's | |
visual position relative to the top left of the viewport, so if the element | |
is part of a scrollable region that has been scrolled, its coordinates will | |
be different than if the region hadn't been scrolled. | |
This method corrects for scroll offsets all the way up the node tree, so the |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"io" | |
"log" | |
"mime/multipart" | |
"net/http" | |
"os" |
URL: http://teamcity:8111/httpAuth/app/rest/projects/
Method: POST
Accept: application/xml
Document doc = Jsoup.parse(...); | |
doc.select("form#login").stream() | |
.map(e -> e.attr("action")) | |
.map(action -> find(action, LINK_ID_PATTERN).group(1)) | |
.filter(Objects::nonNull) | |
.findFirst() | |
.ifPresent(builder::id); | |
content.select("div#datePublished").stream() |
With Node you can write very fast JavaScript programs serverside. It's pretty easy to install Node, code your program, and run it. But > how do you make it run nicely in the background like a true server?
/etc/init/
$ sudo vim yourapp.conf
$ sudo start yourapp
$ sudo stop yourapp
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0-modified | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, |
# First, install all of the things | |
apt-get update | |
apt-get install nginx | |
/etc/init.d/nginx start | |
apt-get install python-dev | |
apt-get install python-pip | |
apt-get install libjpeg-dev libpng-dev libtiff-dev libjasper-dev libgtk2.0-dev python-numpy python-pycurl libwebp-dev python-opencv libjpeg-progs | |
ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib | |
pip install pillow |
# Cache 10GB for 1 Month | |
proxy_cache_path /var/cache/nginx keys_zone=GS:10m inactive=720h max_size=10240m; | |
upstream gs { | |
server 'storage.googleapis.com:80'; | |
keepalive 100; | |
} | |
server { | |
set $my_domain "yourdomain.com"; |