A running example of the code from:
- http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang
- http://nesv.github.io/golang/2014/02/25/worker-queues-in-go.html
Small refactorings made to original code:
# Taken from: https://docs.docker.com/examples/apt-cacher-ng/ | |
FROM ubuntu | |
MAINTAINER sandeepone@gmail.com | |
VOLUME /var/cache/apt-cacher-ng | |
RUN apt-get update && apt-get install -y apt-cacher-ng | |
EXPOSE 3142 | |
CMD chmod 777 /var/cache/apt-cacher-ng && \ | |
/etc/init.d/apt-cacher-ng start && \ |
# read more at https://terrty.net/2014/ssl-tls-in-nginx/ | |
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf | |
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net | |
# your nginx version might not have all directives included, test this configuration before using in production against your nginx: | |
# $ nginx -c /etc/nginx/nginx.conf -t | |
server { | |
# public key, contains your public key and class 1 certificate, to create: | |
# (example for startssl) | |
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null |
#!/bin/bash | |
########################################################################### | |
# Usage: | |
# pre-compress-web-assets [.|folder_name] | |
# | |
# This script will recursively look for the files in the $ext variable | |
# and compress/re-compress them. | |
# | |
# By default it will look into the current working folder, |
__d("Chromedome", ["fbt"], function(a, b, c, d, e, f, g) { | |
f.start = function(h) { | |
if (h.off || top !== window ||!/(^|\.)facebook\.com$/.test(document.domain)) | |
return; | |
var i = h.stop || "Stop!", j = h.text || "This is a browser feature intended for developers. If someone told you to copy-paste something here to enable a Facebook feature or \"hack\" someone's account, it is a scam and will give them access to your Facebook account.", k = h.more || g._("For more information, see {url}.", [g.param("url", 'https://www.facebook.com/selfxss')]); | |
if ((window.chrome || window.safari)&&!h.textonly) { | |
var l = 'font-family:helvetica; font-size:20px; '; | |
[[i, h.c1 || l + 'font-size:50px; font-weight:bold; ' + 'color:red; -webkit-text-stroke:1px black;'], [j, h.c2 || l], [k, h.c3 || l], ['', '']].map(function(r) { | |
setTimeout(console.log.bind(console, '\n%c' + r[0], r[1])); | |
}); |
/** | |
* This jQuery plugin resizes a textarea to adapt it automatically to the content. | |
* @author Amaury Carrade | |
* @version 1.1 | |
* | |
* @example $('textarea').autoResize({ | |
* animate: { // @see .animate() | |
* enabled: true, // Default: false | |
* duration: 'fast', // Default: 100 | |
* complete: function() {}, // Default: null |
A running example of the code from:
Small refactorings made to original code:
// Worker represents the worker that executes the job | |
type Worker struct { | |
JobChannel chan Job | |
quit chan bool | |
} | |
func NewWorker(jobChannel chan Job) Worker { | |
return Worker{ | |
JobChannel: jobChannel, | |
quit: make(chan bool)} |
This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.
Install Raspbian Jessie (2015-09-24-raspbian-jessie.img
) to your Pi's sdcard.
Use the Raspberry Pi Configuration tool or sudo raspi-config
to:
#!/bin/sh | |
# Pre-commit hook for git which removes trailing whitespace, converts tabs to spaces, and enforces a max line length. | |
# The script does not process files that are partially staged. Reason: The `git add` in the last line would fully | |
# stage a file which is not what the user wants. | |
if git rev-parse --verify HEAD >/dev/null 2>&1 ; then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 |
This is a truly async POC Redis client using LibUV. The LibUV extension used here is hhvm-ext-uv by RickySu. That extension has some problems with the latest version of HHVM and has a multiloop
branch that I compiled and used.