Skip to content

Instantly share code, notes, and snippets.

View pmoranga's full-sized avatar

Pmoranga pmoranga

View GitHub Profile
@deinspanjer
deinspanjer / date_and_time_dimensions.sql
Created June 29, 2016 20:08
Magic Date and Time dimensions in PostgreSQL for a data warehouse
BEGIN;
CREATE TABLE dwh.d_date
(
date_key CHAR(10) PRIMARY KEY NOT NULL,
full_date DATE NOT NULL
);
CREATE UNIQUE INDEX d_date_full_date_uindex ON dwh.d_date (full_date);
INSERT INTO dwh.d_date
@andyshinn
andyshinn / Dockerfile
Created December 24, 2015 19:07
BusyBox cron container example
FROM gliderlabs/alpine:3.3
COPY myawesomescript /bin/myawesomescript
COPY root /var/spool/cron/crontabs/root
RUN chmod +x /bin/myawesomescript
CMD crond -l 2 -f
@mahnve
mahnve / gist:a173857078ecf5849dce
Last active August 30, 2022 21:47
get list of AWS us east ip ranges
curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes' | jq 'map(select(.region=="us-east-1"))' | jq 'map(.ip_prefix)'
@eryno
eryno / svn-lint.php
Last active August 29, 2015 14:17 — forked from omnicolor/svn-lint.php
#!/usr/bin/php
<?php
/**
* CLI utility to lint all changed files in a local SVN repo.
* Modified from a pre-commit Subversion script by Omni Adams.
*
* @author Omni Adams <[email protected]>
* @author Eryn O'Neil <[email protected]>
# Transactions with parent-child relationships.
# Delete the index, just in case it still exists.
DELETE /myindex
# Create the index with a mapping for the actual documents and a mapping for the parent transaction type.
PUT /myindex
{
"mappings": {
"transaction": {
<?php
/**
*
*
* @source https://gist.github.com/andypotanin/edad00eb3ff1c2a31f70
*/
header( 'cache-control:no-cache,no-store,private' );
die(json_encode(array(
@jewelia
jewelia / gist:0b8f26e91f2818bef460
Last active August 29, 2015 14:15
3 Great Engineering Management Talks from 2014

General key themes:

  • Hiring is really hard. You’re not just hiring a “Rails Engineer” or a “Python Programmer” you’re hiring someone who can help you change the world. Tell them why! Talk about the hard problems you’re solving. 2/3 of these talks give ideas and insight into hiring from sourcing to actual interview processes.

  • Rewriting systems is hard. People think they are going to replace their broken down horse and buggie with a bullet train and this often ends up in disaster. Successful rewrites require an incremental approach that takes months/years and often runs way over schedule. 2/3 of these talks go over how to handle rewrites not only from a high level technical perspective but a cultural/management perspective as well.

Two Developers, Many Lines of Code, and A Campaign that Made History

Harper Reed (CTO of Obama for America, now CEO of Modest) and Dylan Richard (Director of Eng of Obama for America, now CTO of Modest)

@jewelia
jewelia / gist:595200aae5f9a437a634
Last active August 29, 2015 14:12
Books: 2014 retrospective and to-read for 2015

Many of my friends have shared their reading lists of all the books they read in 2014 (thank you!) -- this gave me some excellent ideas of books to read for 2015.

So I have decided to share my reading list as well, and the list of books I plan to read in 2015. If you have any ideas for additional books, I'd love them (especially in the topic areas of business, finance, nonfiction).

Favorite books I read in 2014:

  • The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers by Ben Horowitz
  • The Everything Store: Jeff Bezos and the Age of Amazon by Brad Stone
  • The Effective Executive: The Definitive Guide to Getting the Right Things Done by Peter F Drucker
  • Zero to One: Notes on Startups, or How to Build the Future by Peter Thiel
@montanaflynn
montanaflynn / proxy.go
Last active June 10, 2025 01:42
Golang reverse proxy
package main
import (
"log"
"net/http"
"net/http/httputil"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
This is a simple OpenVPN setup, with shared HTTPS port. To set up your own Certificate Authority, the easiest way is to follow: https://openvpn.net/index.php/open-source/documentation/howto.html#pki.
Once everything is set up, distribute client.ovpn + client's crt + client's key to each client and everything should work.