Skip to content

Instantly share code, notes, and snippets.

Junio Vitorino juniovitorino

Block or report user

Report or block juniovitorino

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@juniovitorino
juniovitorino / backup.sh
Created Nov 20, 2014
CLONE CLIENTES PARTITION AND SAVE COMPRESSED IMAGE IN AN EXTERNAL HARD DISK (USB)
View backup.sh
#!/bin/bash
# AUTHOR: JUNIO VITORINO | jgvitorino@gmail.com
# DESCRIPTION: DAILY CLONE CLIENTES PARTITION AND SAVE COMPRESSED IMAGE IN AN EXTERNAL HARD DISK (USB)
# DATE: NOVEMBER 20, 2014
rm -rf /backup/*.gz
now=$(date +"%m_%d_%Y")
dd if=/dev/sda5 conv=sync,noerror bs=1K | gzip -c > "/backup/dd_image_clientes_$now.gz"
View gist:c25c2cc15db4feb220db
<?php
// DATABASE
define('DB_NAME', getenv('DB_NAME'));
define('DB_USER', getenv('DB_USER'));
define('DB_PASSWORD', getenv('DB_PASS'));
define('DB_HOST', getenv('DB_HOST'));
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', 'utf8_general_ci');
View gist:75d45df5f0ae54d2e7b1
<?php
// DATABASE
define('DB_NAME', getenv('DB_NAME'));
define('DB_USER', getenv('DB_USER'));
define('DB_PASSWORD', getenv('DB_PASS'));
define('DB_HOST', getenv('DB_HOST'));
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', 'utf8_general_ci');
View excerpt-character-counter.php
function excerpt_count_js(){
if ('page' != get_post_type()) {
echo '<script>jQuery(document).ready(function(){
jQuery("#postexcerpt .handlediv").after("<div style=\"position:absolute;top:12px;right:34px;color:#666;\"><small>Excerpt length: </small><span id=\"excerpt_counter\"></span><span style=\"font-weight:bold; padding-left:7px;\">/ 500</span><small><span style=\"font-weight:bold; padding-left:7px;\">character(s).</span></small></div>");
jQuery("span#excerpt_counter").text(jQuery("#excerpt").val().length);
jQuery("#excerpt").keyup( function() {
if(jQuery(this).val().length > 500){
jQuery(this).val(jQuery(this).val().substr(0, 500));
View convfiles.sh
#!/bin/bash
OUTPUT_PATH='~/app/webroot/files/depoimentos/flv'
MOVIES_PATH='~/app/webroot/files/depoimentos/videos'
ORIGINAL_PATH='~/app/webroot/files/depoimentos/videos_originais'
cd $MOVIES_PATH
for filename in *.*
do
if [ -e $filename ]; then
@juniovitorino
juniovitorino / gist:4252111
Last active Oct 13, 2015
CSS: WordPress default style.css
View gist:4252111
/*
Theme Name:
Theme URI: http://
Description:
Author:
Author URI: http://
Version:
Tags:
License:
@juniovitorino
juniovitorino / gist:4642403
Last active Dec 11, 2015
Rails: MySQL database connection in Rails 3
View gist:4642403
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: your_database_name
pool: 5
username: your_username
password: your_password
socket: /tmp/mysql.sock
@juniovitorino
juniovitorino / gist:4642417
Last active Dec 11, 2015
Rails: SQLite database connection in Rails 3
View gist:4642417
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
@juniovitorino
juniovitorino / gist:4642436
Last active Dec 11, 2015
Rails: Postgres database connection in Rails 3
View gist:4642436
development:
adapter: postgresql
encoding: unicode
database: your_database_name
pool: 5
username: your_username
password: your_password
# Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn't need configuration. Windows does not have
View gist:4677039
#import "Kiwi.h"
#import "User.h"
SPEC_BEGIN(User)
describe(@"User", ^{
context(@"User creation", ^{
it(@"it should have a name", ^{
User *user = [[User alloc] init];
[user setName: @"Junio Vitorino"];
You can’t perform that action at this time.