Skip to content

Instantly share code, notes, and snippets.

View pirafrank's full-sized avatar
🎯
Focusing

Francesco Pira pirafrank

🎯
Focusing
View GitHub Profile
@pirafrank
pirafrank / post_to_GitHub.py
Created January 6, 2016 18:48 — forked from MalphasWats/post_to_GitHub.py
Post to GitHub Pages from Editorial
#coding: utf-8
import keychain
import console
import editor
import time
import re
import requests
import json
@pirafrank
pirafrank / libvips-installer.sh
Created February 3, 2016 22:42 — forked from h2non/libvips-installer.sh
libvips 7.42.x cross-platform simple installer script (supports OSX, Debian, Ubuntu, CentOS, Fedora, Amazon Linux)
#!/bin/sh
#
# Orinally made by Lovell Fuller for sharp
# https://github.com/lovell/sharp
#
# Usage:
# curl -s https://gist.githubusercontent.com/h2non/89bb2f87c6499d0b25f1/raw/bf3d0743107f02f5db2b93c53f7f0e07a1c33112/libvips-installer.sh | sudo bash -
#
@pirafrank
pirafrank / version_compare.js
Created February 25, 2016 00:40 — forked from TheDistantSea/version_compare.js
Function to compare two version strings (e.g. "1.6.1" is smaller than "1.7"). Developed in order to answer http://stackoverflow.com/a/6832721/50079.
/**
* Compares two software version numbers (e.g. "1.7.1" or "1.2b").
*
* This function was born in http://stackoverflow.com/a/6832721.
*
* @param {string} v1 The first version to be compared.
* @param {string} v2 The second version to be compared.
* @param {object} [options] Optional flags that affect comparison behavior:
* <ul>
* <li>
@pirafrank
pirafrank / reset_rails_app.sh
Last active April 4, 2016 08:55
reset/update script to deploy a new stable version of a rails 4.x app served by Puma
#!/bin/bash
# reset/update script to deploy a new stable version of a rails 4.x app served by Puma.
### REQUIREMENTS ###
# this script makes use of another script, 'pumascript'.you can find it in my gists.
# http://gist.github.com/pirafrank
# this script assumes RAILS_ENV is set to 'production' on your server.
@pirafrank
pirafrank / My Sublime Text user preferences
Last active April 11, 2016 07:52
From dev to dev, Sublime Text settings that rock! (OSX compatible)
"hey, don't care about me!"
the purpose of this file is just to properly name the gist (silly Github!).
@pirafrank
pirafrank / jekyllfy_image_urls.sh
Created July 10, 2016 20:23
Script to 'jekyllfy' url images. Replaces your website url with {{site.baseurl}}. Useful when you want to preview your images in editor (iA Writer?) before committing markdown files to repo. sed command is compatible with OS X version of sed.
#!/bin/bash
if [[ $# != 1 ]]; then
echo "Error: you need to pass the path where markdown file are!"
echo "Usage: ./jekyllfy_image_urls.sh [path]"
exit 1
fi
# changing urls... (this edit in place creating NO backup files!)
find "$1" -name "*.md" -exec sed -i '' 's#http://your.website.com#{{site.baseurl}}#g' {} \;
@pirafrank
pirafrank / search.html
Created August 19, 2016 00:52 — forked from flohei/search.html
An example search page for Jekyll running the jekyll-lunr-js-search plugin.
---
layout: default
permalink: /search/
---
<!--
http://10consulting.com/2013/03/06/jekyll-and-lunr-js-static-websites-with-powerful-full-text-search-using-javascript/
-->
<div class="home">
@pirafrank
pirafrank / jekyll-and-liquid.md
Created August 31, 2016 12:50 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@pirafrank
pirafrank / git_install.sh
Created October 22, 2016 10:00
Easy script to download, compile and install Git. Tested in Debian 7 and 8.
#!/bin/bash
# user vars
GIT_VERSION="2.9.1"
# script vars
WORKDIR="/tmp/git_temp"
CUR_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# the actual script
@pirafrank
pirafrank / install_latest_php_raspberrypi.sh
Last active November 1, 2016 13:28
install the PHP version you want on Raspbian. Tested with 5.5 and 5.6. It may work for PHP 7.x, too.
#!/bin/bash
# credits: http://stackoverflow.com/questions/31280912/how-to-install-php-5-6-on-raspbian-wheezy
### VARIABLES ###
# type here the specific php 5.x version you want to install
PHP_VERSION="5.6.20"
### SCRIPT ###