Skip to content

Instantly share code, notes, and snippets.

View daviddias's full-sized avatar

David Dias daviddias

View GitHub Profile
@daviddias
daviddias / distritos-concelhos-freguesias-Portugal.json
Created November 14, 2016 18:10 — forked from tomahock/distritos-concelhos-freguesias-Portugal.json
Level 1 = Distrito, Level 2 = Concelho, Level 3 = Freguesia. Update de 12-07-2016
[
{
"level": 1,
"code": 1,
"name": "Aveiro"
},
{
"level": 2,
"code": 101,
"name": "Águeda"
// This script counts how many days you have been in the USA
// This is a personal script, use it at your own risk
// This is not an official tool and it can do wrong calculations
// which might result in loss in visa status, green card, citizenship
// and whatever you can think of
// This extracts data from the i94 website from the history result view
function daysInYear(year) {
var recs = angular.element(".history-results").scope().vm.recs
@daviddias
daviddias / peermaps-data.md
Created December 19, 2016 02:42
peermaps p2p data format for ad-hoc openstreetmap extracts

peermaps data is ready

Peermaps is a project to bring OpenStreetMap data to the p2p web.

I've just finished a big part of this project: subdividing planet-latest.osm.pbf to support ad-hoc extracts. With ad-hoc extracts over p2p networks, you can download only the parts of planet osm that you need without having to download the whole 34G thing and process it using tens of gigabytes of RAM. Using the peermaps data archive, you can build tile sets for the entire planet on very modest hardware. Every .o5m.gz file is at most 1M. More details below.

@daviddias
daviddias / tmux-cheatsheet.markdown
Created July 17, 2016 19:08 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Software Development Process and Managing It

Introduction

  • We're growing in terms of team and the product
  • We're moving from "prototyping" to "production" --> our needs change
  • Need to shift our mindset to "delivering"
  • Need a way to manage all the 1001 endeavours we have

Introduction to Methodologies

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

#If you're on Ubuntu or working with a Linux VM...

Step 1: Install the Ubuntu dependencies needed:

SSH into your server as a root or do sudo -i.

Then install necessary software:

apt-get update

Leader presumes follower. Follower presumes choice. One who is coerced to the purposes, objectives, or preferences of another is not a follower in any true sense of the word, but an object of manipulation. Nor is the relationship materially altered if both parties voluntarily accept the dominance of one by the other. A true leader cannot be bound to lead. A true follower cannot be bound to follow. The moment they are bound they are no longer leader or follower. If the behavior of either is compelled, whether by force, economic necessity, or contractual arrangement, the relationship is altered to one of superior/subordinate, manager/employee, master/servant, or owner/slave. All such relationships are materially different from leader/follower…

A vital question is how to insure that those who lead are constructive, ethical, open, and honest. The answer is to follow those who behave in that manner. It comes down to both individual and collective sense of where and how people choose to be led. In a very real sens

var Docker = require('dockerode');
var docker = new Docker({socketPath: '/var/run/docker.sock'});
docker.createContainer({ Image: 'ubuntu', Cmd: ['/bin/ls','/stuff'], "Volumes":{"/stuff": {}} }, function (err, container) {
container.attach({stream: true, stdout: true, stderr: true, tty: true}, function (err, stream) {
stream.pipe(process.stdout);
container.start({"Binds":["/home/vagrant:/stuff"]}, function (err, data) {
console.log(data);