Skip to content

Instantly share code, notes, and snippets.

View scorphus's full-sized avatar
Brewing at 🏡 office

Pablo Aguiar scorphus

Brewing at 🏡 office
View GitHub Profile
@scorphus
scorphus / memoize.py
Created May 13, 2016 21:35
Memoize with timeout
class memoize(dict):
def __init__(self, func, timeout=15):
logger.info('Initiating cache for %s', func)
self.func = func
self.timeout = None
if timeout:
self.timeout = float(timeout)
def __call__(self, *args):
@scorphus
scorphus / ipip.fish
Created June 6, 2016 17:24
Jus a pip wrapper
function ipip -d "Indexes-aware pip"
if test (count $argv) -ge 2
if test $argv[1] = "install"
if test (count $PIP_INDEX_URLS) -ge 1
set index_urls "--index-url"=$PIP_INDEX_URLS[1]"simple/"
set trusted_host (__extract_domain $PIP_INDEX_URLS[1]"simple/")
set trusted_hosts "--trusted-host" $trusted_host
if test (count $PIP_INDEX_URLS) -ge 2
for index_url in $PIP_INDEX_URLS[2..-1]
set index_urls $index_urls "--extra-index-url"=$index_url"simple/"
@scorphus
scorphus / r2d2-couchdb-example.rs
Created September 4, 2016 06:15
Using a connection pool for CouchDB in Rust with r2d2-couchdb
extern crate r2d2;
extern crate r2d2_couchdb;
extern crate serde_json;
use r2d2_couchdb::{CouchdbConnectionManager};
use std::thread;
use std::time::Duration;
fn main() {
@scorphus
scorphus / keybase.md
Last active March 2, 2018 21:28
Keybase proof

Keybase proof

I hereby claim:

  • I am scorphus on github.
  • I am pablito (https://keybase.io/pablito) on keybase.
  • I have a public key ASDYg1IWkWcdYXP00eGQAkWVkcPgEtD0GCRBBAGT_XuT6Ao

To claim this, I am signing this object:

@scorphus
scorphus / reverse-proxy.go
Created November 24, 2016 15:32
NewSingleHostReverseProxy with RoundTrip – read: connection reset by peer
package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
"net/http/httputil"
@scorphus
scorphus / pink-october.css
Last active October 23, 2017 19:44
Pink October Jenkins Monitor
.build-monitor .successful {
background-color: #EA80B0;
}
.build-monitor .project.successful > .progress {
background-color: #A85C7F;
}
@keyframes forSuccessful {
0% {
@scorphus
scorphus / halloween.css
Last active October 31, 2017 12:28
Hallowenn Jenkins Monitor
.build-monitor .successful {
background-color: hsl(36, 100%, 50%);
}
.build-monitor .project.successful > .progress {
background-color: hsl(36, 100%, 40%);
}
@keyframes forSuccessful {
0% {
@scorphus
scorphus / dataclasses.py
Created December 19, 2017 16:16
Experimentations with Data Classes (PEP 557 – https://www.python.org/dev/peps/pep-0557/)
from dataclasses import dataclass
from itertools import groupby
from operator import countOf
from typing import Callable, Dict, Iterable, List, Tuple
@dataclass
class Document:
url: str
title: str
@scorphus
scorphus / job-hunting.md
Created February 13, 2018 16:39 — forked from yangshun/job-hunting.md
Some resources for the job hunting season

Tech Job Hunting

Mock Interview Sites

Would advise you all to practice just for fun. I know a lot of students don't get much practice for interviews.

  • interviewing.io - Allows you to have mock interviews with engineers from the bay area (so they say, but I am an interviewer on the platform too). I personally like this platform a lot and used it both as an interviewee and an interviewer.
  • Pramp - Peer-to-peer mock interviews. You get matched with another person, get assigned questions and take turns to be interviewer/interviewee. I personally dislike this platform a lot because I had a horrible experience being matched with some guy who didn't know shit about regular expressions, gave me a wrong test case, and led me down the wrong path of solving the question.
@scorphus
scorphus / JobInterviewQuestionsYouShouldAsk.md
Last active February 16, 2018 16:06 — forked from hdznrrd/jobinterviewquestions.txt
Job Interview Questions You Should Ask

These are some questions you really should ask in a job interview.

Software development

  • Which platforms (Linux, Windows, Mac, Embedded) will I develop for?

  • What programming languages are you using for which kind of projects / applications?

  • What Development Environment are you using?

  • Are you using any coding style guidelines? If yes, can I take a look at the document?

  • Are you actively supporting / allowing time for keeping your code base maintainable and up to date?