Skip to content

Instantly share code, notes, and snippets.

David Dias daviddias

Block or report user

Report or block daviddias

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View i94-count-days-in-usa.js
// 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 Dec 19, 2016 — forked from substack/peermaps-data.md
peermaps p2p data format for ad-hoc openstreetmap extracts
View peermaps-data.md

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 / distritos-concelhos-freguesias-Portugal.json
Created Nov 14, 2016 — forked from tomahock/distritos-concelhos-freguesias-Portugal.json
Level 1 = Distrito, Level 2 = Concelho, Level 3 = Freguesia. Update de 12-07-2016
View distritos-concelhos-freguesias-Portugal.json
[
{
"level": 1,
"code": 1,
"name": "Aveiro"
},
{
"level": 2,
"code": 101,
"name": "Águeda"
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View Software Development Process and Managing It - PL Team Week Lisbon 2016.md

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

View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

View headless.md

#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
View deehock-leadership.md

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

View gist:d3717e292a5cbd5beb7f
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);
You can’t perform that action at this time.