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
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"];
@juniovitorino
juniovitorino / invoke_class_method.m
Last active Dec 12, 2015
Invoking class methods
View invoke_class_method.m
@interface Person : NSObject
+(BOOL) walking;
@end
@interface Philip : Person
+(BOOL) walking;
@end
@implementation Philip
@juniovitorino
juniovitorino / Guardfile
Last active Dec 17, 2015
Guard simple boilerplate
View Guardfile
# More info at https://github.com/guard/guard#readme
guard 'sass', :input => 'sass', :output => 'css', :style => :compressed, :no => :cache
guard :livereload do
watch %r{.+\.(php|html|css|js)$}
end
guard :concat, type: 'js', files: %w(), input_dir: 'js', output: 'js/app'
@juniovitorino
juniovitorino / gist:5587839
Created May 15, 2013
Hotlink Protection
View gist:5587839
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?youralloweddomain.com [NC]
RewriteRule \.(jpeg|jpg|gif|pdf)$ - [NC,F,L]
</IfModule>
@juniovitorino
juniovitorino / xss_sanitization.php
Last active Dec 17, 2015
WordPress Recursive XSS Sanitization
View xss_sanitization.php
// XSS HTTP Treatment
add_filter('init', 'xssTreatment');
function xssTreatment() {
foreach(array($_GET, $_POST, $_REQUEST) as $httpConst) XSSSanitization( $httpConst );
}
function XSSSanitization(&$param) {
if(!is_array( $param ) && is_string( $param ) ) $param = filter_var($param, FILTER_SANITIZE_STRING);
You can’t perform that action at this time.