Skip to content

Instantly share code, notes, and snippets.

View nffdiogosilva's full-sized avatar
🚀
Focused

Nuno Diogo da Silva nffdiogosilva

🚀
Focused
View GitHub Profile
@nffdiogosilva
nffdiogosilva / .bash_profile
Created December 17, 2018 15:44 — forked from helderco/.bash_profile
Packages installation in a fresh installation of MacOS X.
# Aliases
alias ls='ls -hG'
alias ll='ls -l'
alias la='ls -A'
alias lla='ls -lA'
alias le='ls -lAeO@'
alias cleardns="dscacheutil -flushcache"
alias crontab="VIM_CRONTAB=true crontab"
alias gl="git log --graph --pretty='format:%C(yellow)%h%Cblue%d%Creset %s %C(white)%an, %ar%Creset'"
@nffdiogosilva
nffdiogosilva / proxy_nginx.sh
Created December 17, 2018 15:43 — forked from rdegges/proxy_nginx.sh
Create a HTTP proxy for jenkins using NGINX.
sudo aptitude -y install nginx
cd /etc/nginx/sites-available
sudo rm default
sudo cat > jenkins
upstream app_server {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;
@nffdiogosilva
nffdiogosilva / paginator.py
Created March 31, 2016 22:40
A paginator class
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
class Paginator(object):
"""
Class that defines a Paginator.
"""
def __init__(self, current_page, total_pages, boundaries=1, around=0, fail_silently=False):
self.fail_silently = fail_silently
@nffdiogosilva
nffdiogosilva / changetheme.py
Last active December 22, 2015 21:49
Script that i made, responsible to change Sublime Solarized Theme depending on daytime. Should be use with anacron or fcron. Example using with cron job: 00 8,20 * * * python ~/.bin/changetheme.py
# -*- coding: utf-8 -*-
from os.path import expanduser
from datetime import datetime as day
HOME_DIR = expanduser("~")
SUBLIME_USER_PREFERENCES_PATH = '/Library/Application Support/Sublime Text 2/Packages/User/Preferences.sublime-settings'
class SublimeTheme(object):
def __init__(self, path=HOME_DIR + SUBLIME_USER_PREFERENCES_PATH, min_hour=8, max_hour=20):