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
<?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.
/*
* 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.",
<?php
/*
|--------------------------------------------------------------------------
| Delete form macro
|--------------------------------------------------------------------------
|
| This macro creates a form with only a submit button.
| We'll use it to generate forms that will post to a certain url with the DELETE method,
| following REST principles.
<?php
View::composer(Paginator::getViewName(), function($view) {
$query = array_except( Input::query(), Paginator::getPageName() );
$view->paginator->appends($query);
});
#!/bin/sh
echo "-----------------------------------------------"
echo " Initial Configuration Ubuntu: By Mandado "
echo "-----------------------------------------------"
# System upgrade
echo "Updating repositories and upgrading system"
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
clear
#!/usr/bin/env ruby
require 'mail'
mysql_username = 'root'
mysql_password = '123456'
mysql_database = 'test'
system("mysqldump --user=#{mysql_username} --password=#{mysql_password} #{mysql_database} > backup.sql")
# Credit to :
# encoding: utf-8
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
<?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
<textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea>
...
<textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea>
...
<script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script>
<script>
// Hook up ACE editor to all textareas with data-editor attribute
$(function () {