Skip to content

Instantly share code, notes, and snippets.

Francesco Pira pirafrank

Block or report user

Report or block pirafrank

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 .gitignore for Rails app
# See http://help.github.com/ignore-files/ for more about ignoring files.
# Based on https://gist.github.com/chrishough/6488118
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
###############################################################################################
# Ignore specific config files
###############################################################################################
.bundle/*
@pirafrank
pirafrank / bash custom colors
Last active Aug 29, 2015
Quick and beautiful bash make up
View bash custom colors
# Terminal custom colors
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
@pirafrank
pirafrank / bash history settings
Created Mar 24, 2015
Elephant memory for your bash
View bash history settings
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=10000
HISTFILESIZE=10000
View fix locale errors in bash
#fix locale errors
export LANG="en_US.UTF-8"
export LC_ALL=$LANG
@pirafrank
pirafrank / pumascript.sh
Last active Aug 29, 2015 — forked from joneslee85/puma.sh
Puma manager script for your Rails application
View pumascript.sh
#!/usr/bin/env bash
# This software is given AS IS, WITHOUT ANY WARRANTY.
# Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`.
# Please modify the CONSTANT variables to fit your configurations.
# The script will start with config set by $PUMA_CONFIG_FILE by default
# forked from joneslee85 https://gist.github.com/joneslee85/5844933
@pirafrank
pirafrank / filesharing2.py
Last active Aug 29, 2015
Local filesharing command line program written in Python
View filesharing2.py
# Copyright 2014 Francesco Pira <dev@fpira.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@pirafrank
pirafrank / PyObjc Python modules cleaner script
Created Aug 13, 2015
Script to clean up from pyobjc-framework Python modules
View PyObjc Python modules cleaner script
#!/bin/bash
# Cleaner script for pyobjc-framework python modules
#
# made by Francesco Pira
# fpira.com
# Given "as-is", WITHOUT ANY WARRANTY
#
# Usage:
# chmod +x ./this-script.sh
@pirafrank
pirafrank / get_platform_details.py
Created Aug 20, 2015
Get platform details for current OS (print or use as a library). Works with Linux, OS X and Windows.
View get_platform_details.py
import sys
import platform as pl
def get_os_release():
if pl.system() == "Darwin":
var = pl.mac_ver()[0] # mac release
elif pl.system() == "Linux":
var = pl.linux_distribution() # which linux distro
elif pl.system() == "Windows":
@pirafrank
pirafrank / open-with-default-application.py
Created Aug 20, 2015
Open given file with the default application. Works on Linux, OS X and Windows. On Linux requires xdg-open (usually built-in).
View open-with-default-application.py
import sys
import subprocess
import os
import platform
def open_with_default(path):
current_platform = platform.system()
if current_platform == "Linux":
subprocess.call(["xdg-open", path])
View keybase.md

Keybase proof

I hereby claim:

  • I am pirafrank on github.
  • I am pirafrank (https://keybase.io/pirafrank) on keybase.
  • I have a public key whose fingerprint is 8CE5 6166 AD46 3442 9E3A CF7C 03F3 1E01 C9DC 0E67

To claim this, I am signing this object:

You can’t perform that action at this time.