Skip to content

Instantly share code, notes, and snippets.

View fabiancarlos's full-sized avatar
🚀
Go!

Fabian Carlos fabiancarlos

🚀
Go!
View GitHub Profile
@fabiancarlos
fabiancarlos / .bash_aliases
Created February 11, 2014 15:27
ultimate git prompt colors S2
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@fabiancarlos
fabiancarlos / phonegap_back.js
Last active August 29, 2015 13:57
Back like button on Phonegap w/ AngularJS
// add a element with id="homegap" on the template home of the app
app_helper = {
initialize: function() {
this.bindEvents();
},
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
onDeviceReady: function(){
var gcm = require('node-gcm');
var message = new gcm.Message();
//API Server Key
var sender = new gcm.Sender('AIzaSyCDx8v9R0fMsAsjoAffF-P3FCFWXlvwLhg');
var registrationIds = [];
// Value the payload data to send...
message.addData('message',"\u270C Peace, Love \u2764 and PhoneGap \u2706!");
message.addData('title','Push Notification Sample' );
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@fabiancarlos
fabiancarlos / webview.js
Created March 14, 2017 21:54
REact native webview.js
_openModal(){
console.log("OPEN WEB VIEW");
this.setState({modalVisible: !this.state.modalVisible});
}
.... render ...
<Modal
animationType={"slide"}
@fabiancarlos
fabiancarlos / api.js
Last active April 20, 2017 20:58
Api REST
import * as CurrentUser from './current_user';
class Api {
static get(route) {
return this.xhr(route, null, 'GET');
}
static put(route, params) {
return this.xhr(route, params, 'PUT')
@fabiancarlos
fabiancarlos / fc-product-total-sales.php
Created July 13, 2018 23:11
Woocommerce plugin: Total Vendido do Produto
<?php
/**
* Plugin name: Total Vendido do Produto
* Plugin uri: https://github.com/fabiancarlos
* Description: Agrupar a totalidade das vendas e mostrar abaixo do preço
* Version: 1.0
* Author: Fabian
* Author uri: http://github.com/fabiancarlos
* License: GPLv2 or later
@fabiancarlos
fabiancarlos / gist:8c9b216c57e14696c10e4f52ff08a492
Created January 2, 2019 22:11 — forked from rolo/gist:1481128
Install Postgres 9.1, PostGIS and create PostGIS template on Ubuntu 11.10 Oneiric Ocelot
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
@fabiancarlos
fabiancarlos / rails http status codes
Created April 10, 2019 23:21 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@fabiancarlos
fabiancarlos / mautic
Last active February 27, 2020 15:03
Mautic, NGINX, PHP FPM 7.033, MariaDB
NGINX
PHP-FPM 7.0.33
server {
listen 80;
root /var/www/html/mautic;
index index.php index.html index.htm index.nginx-debian.html;
server_name mautic.your_domain.com;