Skip to content

Instantly share code, notes, and snippets.

View rbarros's full-sized avatar

Ramon Barros rbarros

  • Tr4ctor Soluções Inteligentes
  • Brazil
View GitHub Profile
@rbarros
rbarros / laravel5.sh
Created January 11, 2016 17:56
Installing Laravel 5
#!/bin/bash
# Ubuntu Developer Script For Laravel 5
# Ramon Barros
# contato [a] ramon-barros.com
# v0.1.0
#
# Download and configures the following:
#
# curl
# composer
@rbarros
rbarros / Preferences.sublime-settings
Created January 6, 2016 10:53
Sublime Text - Settings User
{
"caret_style": "phase",
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
var value = 170090; // 'R$ 1.700,90'
var money = parseInt(value.replace(/[\D]+/g,''))
.toString()
.replace(/([0-9]{2})$/g, ',$1')
.replace(/([0-9]{3}),([0-9]{2}$)/g, '.$1,$2')
@rbarros
rbarros / git-update.sh
Last active November 23, 2015 18:05
Script para criar arquivo .tar.gz com os arquivos dos commits informados.
#!/bin/bash
# Ramon Barros
# contato [a] ramon-barros.com
# v0.1.0
#md5sum="md5sha1sum-0.9.5"
#"wget microbrew.org/tools/md5sha1sum/md5sha1sum-0.9.5.tar.gz" - automatizar instalação
md5="git-update.sh"
file_hash=$(date +"%m%d%Y%H%M%S") #"$(echo -n "$md5" | md5sum | awk '{ print $1 }' )"
tmp="tmp"
@rbarros
rbarros / git-ftp-config.sh
Created July 16, 2015 20:34
Script para configuração do git-ftp.
#!/bin/bash
# Ramon Barros
# contato [a] ramon-barros.com
# v0.1.0
echo "Script para configuração do git-ftp."
verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -n | head -n1`" ]
}
@rbarros
rbarros / correios.md
Last active August 29, 2015 14:20
Serviços mais utilizados nos correios.
@rbarros
rbarros / fix1.sh
Created February 12, 2015 20:29
This script remove malware of PHP files.
#!/bin/bash
#
# This script remove malware of PHP files.
#
# In this case it will remove some malicious code
# from all Wordpress PHP files that is at top of
# every PHP file.
#
# The string at the top of every file is:
#
@rbarros
rbarros / lista_palavras.c
Last active August 29, 2015 14:13
Exemplos em C/C++
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
void main() {
char aux[256], *words[50], *pTmp;
int c, i;
// Lê string
@rbarros
rbarros / OnBeforeUnLoad.js
Created October 9, 2014 13:05
OnBeforeUnLoad
// include EventListener https://gist.github.com/rbarros/6c7888320ee0cdc3bab7
// include Ajax https://gist.github.com/rbarros/2776240
function OnBeforeUnLoad(e) {
e.preventDefault();
var ajax = Ajax.open({
method: 'GET',
url: 'http://localhost/',
dataType: 'json',
//data: { id: 1 },
success: function (json) {
@rbarros
rbarros / EventListener.js
Created October 9, 2014 13:02
EventListener
/*! EventListener - v1.0.0 - 2014-05-30
* Controla os eventos de click
* Copyright (c) 2014 Ramon Barros; Licensed MIT */
(function (root) {
'use strict';
var EventListener = function () {
this.version = '1.0.0';
};
EventListener.prototype.addEvent = function(el, type, fn) {