Skip to content

Instantly share code, notes, and snippets.

@tmslnz
tmslnz / basic-promise.js
Last active August 29, 2015 14:24 — forked from rc1/gist:b556844e290997b447e4
A most simple promise system, to explain promises
// A most simple promise system, to explain promises
var p = promise( function ( resolve, reject ) {
// do async stuff here
fs.readFile( function ( err, file ) {
if ( err ) {
reject( new Error( 'it mucked up' ) );
} else {
resolve( file );
}
@tmslnz
tmslnz / process-from-id.sh
Last active August 29, 2015 14:23
Get the process name from its id
# To know what process has id 1
stat /proc/1/exe
@tmslnz
tmslnz / the-workers.txt
Created November 6, 2014 11:45
The Workers ASCII Art
________ _ __ __ ___
/_ __/ /_ ___| | / /___ _____/ /_____ __________ / /
/ / / __ \/ _ \ | /| / / __ \/ ___/ //_/ _ \/ ___/ ___/ / /
/ / / / / / __/ |/ |/ / /_/ / / / ,< / __/ / (__ ) _/ ./
/_/ /_/ /_/\___/|__/|__/\____/_/ /_/|_|\___/_/ /____/ / ./
.net / /
. /./
.. | // .
. \\ | /' .' .
~-. ` ' .-~
@tmslnz
tmslnz / git-serve.md
Last active August 29, 2015 14:07 — forked from datagrok/git-serve.md

Launch a one-off git server from any local repository.

I [tweeted this already][1] but I thought it could use some expansion:

Enable decentralized git workflow:

git config alias.serve "daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/"

Say you use a git workflow that involves working with a core "official" repository that you pull and push your changes from and into. I'm sure many companies do this, as do many users of git hosting services like Github.

@tmslnz
tmslnz / nmap+grep.sh
Created October 15, 2014 11:25
List all network devices on a range
# Use -n -sn to tell Nmap to ignore hostnames
nmap -sn 192.168.1.0/24 -oG - | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'
@tmslnz
tmslnz / Sift3B.js
Created September 21, 2014 13:31
String distance
// http://siderite.blogspot.com/2007/04/super-fast-and-accurate-string-distance.html
function sift3B(s1, s2, maxOffset, maxDistance) {
if (s1 == null||!s1.length) {
if (s2 == null) {
return 0;
}
return s2.length;
}
/*
Superfast Blur - a fast Box Blur For Canvas
Version: 0.5
Author: Mario Klingemann
Contact: mario@quasimondo.com
Website: http://www.quasimondo.com/BoxBlurForCanvas
Twitter: @quasimondo
// For options and giggles:
// https://github.com/ai/autoprefixer
var autoprefixer = require('autoprefixer');
var fs = require('fs');
var url = require('url');
var path = require('path');
var filesMap = {};
server {
server_name "~^((?<subdomain>www)\.)?(?<domain>location\.com)$";
index index.php index.htm index.html default.asp;
## Performs 301 redirects to non-www plus other minor things.
#include templates/server.main.conf;
# ----------------------------------------------------------------------->
# set main domain root to _
if ($subdomain = "") {
Hello <Recipient>,
Thanks for you email. We are aware that the resolution is not the highest available to date, but those pictures were taken with a 10mp <You Camera From 2 yrs ago here> more than 2 years ago.
I have printed large format from that resolution in the past and the pixel density is perfectly fine.
In A2 there is no issue (59.4cm long side, comes at 166.255dpi); if anything A1 might show a bit of loss, as it results in a density of 117.566dpi.
However it seems that the values you mentioned were taken considering a 300dpi resolution, which means our A1 should be 9921 x 6614 pixels, or 65 megapixels. Upsampling the originals to those values will only make the files bigger, with no improvement on quality.
Please take into consideration that prints in such large formats are usually not viewed up close (300dpi is already more than plenty on an A4). This said, we think there should be no particular issue with printing on those formats.
Please be in touch if you have any other questions.