Skip to content

Instantly share code, notes, and snippets.

View ohvitorino's full-sized avatar

Bruno Pinto Vitorino ohvitorino

View GitHub Profile
@ohvitorino
ohvitorino / laravel-queue.service
Created April 26, 2024 09:34 — forked from thomasjsn/laravel-queue.service
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker
@ohvitorino
ohvitorino / jekyll-and-liquid.md
Created January 8, 2018 08:05 — 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:

@ohvitorino
ohvitorino / Overview.txt
Created June 10, 2016 12:04 — forked from juneym/Overview.txt
Task Object, Coordination & Chain of Responsibility Design pattern
Overview:
This was an example I have given to my co-developer who was doing some Task/Coodinator type of code. Hope this is helpful to many other developers out there.
Note that the example only supports one-to-one dependency between TaskObject instance. The TaskAbstract class can be easily modified to support 1-to-many dependency.
For simpicity, I have combined all three classes in this single gist:
1. TaskAbstract
2. TaskObject (extends TaskAbstract)
3. TaskCoordinator (extends TaskAbstract)
@ohvitorino
ohvitorino / pubsub.js
Created May 6, 2016 12:06 — forked from learncodeacademy/pubsub.js
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
@ohvitorino
ohvitorino / csv-to-json.php
Created January 22, 2016 13:00 — forked from robflaherty/csv-to-json.php
Convert CSV to JSON
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed
@ohvitorino
ohvitorino / upgrade_pg.sh
Last active August 29, 2015 14:00 — forked from ibussieres/upgrade_pg.sh
Upgrade PostgreSQL from 9.1 to 9.3
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 postgresql-contrib-9.3 -y
#In case of error on previous step
# sudo update-alternatives --remove postmaster.1.gz /usr/share/postgresql/9.1/man/man1/postmaster.1.gz
# sudo apt-get install -f
# sudo apt-get install --reinstall postgresql-9.1
@ohvitorino
ohvitorino / cartodb20_build.sh
Last active May 21, 2020 18:11 — forked from ericmagnuson/cartodb20_build.sh
CartoDB installation on Ubuntu 12.04
###################################
## CartoDB 2.0 Install [Working] ##
## Tested on Ubuntu 12.04 ##
###################################
sudo apt-get update
sudo apt-get safe-upgrade -y
# Install miscellaneous dependencies packages
sudo apt-get install -y git-core python-software-properties openmpi-bin libopenmpi-dev build-essential libxslt-dev zlib1g-dev ruby gems unzip