Profile | download (kb/s) | upload (kb/s) | latency (ms) |
---|---|---|---|
Native | 0 | 0 | 0 |
GPRS | 50 | 20 | 500 |
56K Dial-up | 50 | 30 | 120 |
Mobile EDGE | 240 | 200 | 840 |
2G Regular | 250 | 50 | 300 |
2G Good | 450 | 150 | 150 |
3G Slow | 780 | 330 | 200 |
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
on run argv | |
set repoPath to (item 1 of argv) | |
tell application "iTerm" | |
set newWindow to (create window with default profile) | |
tell current session of newWindow | |
write text "cd " & quoted form of repoPath & " && npx git-cz" | |
end tell | |
end tell | |
end run |
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
(function() { | |
const scroller = document.scrollingElement || document.body; | |
// Smooth scrolls to the bottom of the page. | |
window.smoothScrollPage = (y = scroller.scrollHeight) => { | |
scroller.style.scrollBehavior = 'smooth'; | |
scroller.scrollTop = y; | |
scroller.style.scrollBehavior = ''; | |
}; |
Pattern file: /etc/logstash/patterns/nginx
Logstash shipper: /etc/logstash/conf.d/shipper.conf
Nginx http log module: http://nginx.org/en/docs/http/ngx_http_log_module.html
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
var express = require('express'); | |
var app = express(); | |
var path = require('path'); | |
app.use(express.static(path.join(__dirname))); | |
app.use("/styles", express.static(__dirname)); | |
app.use("/images", express.static(__dirname + '/images')); | |
app.use("/scripts", express.static(__dirname + '/scripts')); | |
// viewed at based directory http://localhost:8080/ |
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
'use strict'; | |
const kue = require('kue'); | |
const url = require('url'); | |
const redis = require('redis'); | |
var getRedis = () => { | |
var redisUrl = url.parse(process.env.LOCAL_REDIS_URL || config.Redis.RedisUrl) | |
, client = redis.createClient(redisUrl.port, redisUrl.hostname); | |
// console.log({ action: 'app', redisUrl: redisUrl }); | |
if (redisUrl.auth) { |
An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.
This is a basic collection of things I do when setting up a new headless ubuntu machine as a webserver. Following the steps below should give you a reasonable secure server with HTTP/2 support (including ALPN in chrome) and the fast NGINX server. I am happy to add things so leave a comment.
After creating the server (droplet on DigitalOcean) log in with
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
/** | |
* A model base class that extends Backbone.Model to provide both | |
* common functionality and common model properties. | |
* | |
* Common properties are defined by property configuration data objects returned | |
* by the propConfig getter. | |
* | |
* Common functionality determined by propConfig includes: | |
* - defaults | |
* - server data parsing |
NewerOlder