Skip to content

Instantly share code, notes, and snippets.

View dbautistav's full-sized avatar

David Bautista dbautistav

  • http://localhost:4200
View GitHub Profile
@dbautistav
dbautistav / Dockerfile
Created October 20, 2016 19:46 — forked from dweinstein/Dockerfile
testProject
FROM ubuntu
MAINTAINER David Weinstein <david@bitjudo.com>
# install our dependencies and nodejs
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get -y install python-software-properties git build-essential
RUN add-apt-repository -y ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get -y install nodejs
@dbautistav
dbautistav / introrx.md
Created January 3, 2017 19:08 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

Reading data before application startup in Angular 2

In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.

This is how the demonstration will load data:

a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';

b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.

//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@dbautistav
dbautistav / explanation.md
Created February 9, 2017 17:46 — forked from masak/explanation.md
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@dbautistav
dbautistav / flights_spider.py
Last active March 10, 2018 21:16
flights-scrapy
import scrapy
class FlightsSpider(scrapy.Spider):
name = "flights"
start_urls = [ 'https://www.google.com/flights/' ]
def parse(self, response):
title = response.css('title::text').extract_first()
print '##### THE TITLE IS: ' + title
@dbautistav
dbautistav / github-pages-custom-domain-gandi-dns-records.md
Created March 17, 2021 02:19 — forked from matt-bailey/github-pages-custom-domain-gandi-dns-records.md
How to set up DNS records on gandi.net to use a custom domain on Github Pages

How to set up DNS records on gandi.net to use a custom domain on Github Pages

You would think it would be easy to find this information, but none of the Github or Gandi documentation is clear so I have recorded the required steps here.

Create the following A records:

@ 1800 IN A 185.199.108.153
@ 1800 IN A 185.199.109.153
@ 1800 IN A 185.199.110.153