Skip to content

Instantly share code, notes, and snippets.

View mandado's full-sized avatar

Jorge Roberto Tomaz Junior mandado

  • Juiz de Fora - Minas Gerais
View GitHub Profile
#!/bin/sh
# Keys
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt-key adv - keyserver pgp.mit.edu - recv-keys 5044912E
# Repositories
sudo add-apt-repository -y ppa:webupd8team/java
sudo add-apt-repository -y ppa:diesch/testing
sudo add-apt-repository -y ppa:webupd8team/experiments
@mandado
mandado / Plugins
Last active December 18, 2015 03:59
Nome dos Plugins a serem instalados no sublime Text 2.
BracketHighlighter,
Sublime Lint,
JS Format,
Emmet,
Emmet Css Snippet,
prefixr,
Placeholders,
Alignment,
Sublimipsum,
AutoBackups,
@mandado
mandado / Cart Class
Last active December 19, 2015 01:38
Class of shopping Cart for studies
<?php
require './KeyNotFoundException.php';
class Cart{
protected $item;
public function __construct() {
$this->item = [];
@mandado
mandado / Backbone Exemplo
Created July 1, 2013 15:13
Estudando BackBone
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="jquery.js"></script>
<script src="lodash.js"></script>
<script src="backbone.js"></script>
</head>
<body>
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@mandado
mandado / Forçar Download
Created July 15, 2013 20:29
Script básico de forçar download em php.
<?php
//$file = "/folder/filename.ext";
function force_download($file) {
$ext = explode(".", $file);
switch($ext[sizeof($ext)-1]) {
case 'jar':
$mime = "application/java-archive";
break;
case 'zip':
$mime = "application/zip";
@mandado
mandado / gist:6057296
Created July 22, 2013 20:20
Sql estados e cidades
This file has been truncated, but you can view the full file.
#
# Encoding: Unicode (UTF-8)
#
DROP TABLE IF EXISTS `tb_cidades`;
DROP TABLE IF EXISTS `tb_estados`;
CREATE TABLE IF NOT EXISTS `tb_cidades` (
/*
* Translated default messages for the jQuery validation plugin.
* Locale: PT_BR
*/
jQuery.extend(jQuery.validator.messages, {
required: "Este campo &eacute; requerido.",
remote: "Por favor, corrija este campo.",
email: "Por favor, forne&ccedil;a um endere&ccedil;o eletr&ocirc;nico v&aacute;lido.",
url: "Por favor, forne&ccedil;a uma URL v&aacute;lida.",
date: "Por favor, forne&ccedil;a uma data v&aacute;lida.",
@mandado
mandado / gist:6100732
Created July 28, 2013 23:37
Codigo illuminate
<?php
include 'database-master/Capsule/Manager.php';
use Illuminate\Database\Capsule\Manager as Capsule;
$capsule = new Capsule;
$capsule->addConnection([
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'camilaferreira',
'username' => 'root',
@mandado
mandado / gist:6101862
Created July 29, 2013 02:37
Instalando o iluminate
{
"require": {
"illuminate/database": "*"
}
}