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 / 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"}
// 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);
});
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' );
@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(){
@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 / rails4_angularjs.js
Created February 7, 2014 18:56
Rails 4 w/t AngularJS, fix to use with turbolinks
var yourApp = angular.module('yourApp', []);
// fix 1
$(document).on('ready page:load', function(){
angular.bootstrap(document.body, ['yourApp']);
});
// or
@fabiancarlos
fabiancarlos / rails_locale.md
Created January 12, 2014 18:29
Rails tradução para pt-BR
@fabiancarlos
fabiancarlos / style.css
Last active January 2, 2016 15:49 — forked from mwbrooks/style.css
* {
-webkit-touch-callout:none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust:none; /* prevent webkit from resizing text to fit */
-webkit-tap-highlight-color:rgba(0,0,0,0); /* prevent tap highlight color / shadow */
-webkit-user-select:none; /* prevent copy paste, to allow, change 'none' to 'text' */
}
// or to use on specific template add a class on body
// <body class="mobile-higlight-off">
// <!-- html stuff -->
@fabiancarlos
fabiancarlos / heroku_ex_comands.md
Created October 31, 2012 15:01
Heroku Essential Comands
heroku logs # visualize the logs executions of the website
heroku pg:reset SHARED_DATABASE # To drop the database, if using SHARED_DATABASE_URL
@fabiancarlos
fabiancarlos / git_ex_comands.md
Last active October 12, 2015 05:27
Git Essential Comands
git init # initalize a empty git repo
git status # check modifications in the repo repo
git log # check commits in the git repo