Skip to content

Instantly share code, notes, and snippets.

Junio Vitorino juniovitorino

View GitHub Profile
View index.html
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>JS Module in Browser</title>
<script type="module" src="./js/main.js"></script>
juniovitorino / ncenter
Created Nov 12, 2013
Load/Unload OS X Notification Center
View ncenter
# Notification Center
alias ncstop="launchctl unload -w /System/Library/LaunchAgents/"
alias ncstart="launchctl load -w /System/Library/LaunchAgents/"
juniovitorino /
Created Jun 29, 2016 — forked from tmiller/
DigitalOcean ubuntu 14.04 server configuration script.
# Setup user
adduser $username
usermod -a -G sudo $username
sudo mkdir -p "/home/${username}/.ssh"
sudo echo "${ssh_pub_key}" > "/home/${username}/.ssh/authorized_keys"
View AppLock.mobileconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<string>Disables the home button.</string>
View Procfile
web: /usr/local/sbin/nginx -p `pwd`/tmp/nginx/ -c ../../nginx.conf
fastcgi: /usr/local/sbin/php-fpm
db: /usr/local/bin/mysqld
juniovitorino / toEM.sass
Last active Dec 19, 2015
SASS Function to convert PX in EM
View toEM.sass
$em-base: 16px !default;
@function toEM($px) {
@return $px / $em-base * 1em;
juniovitorino / remove-extension.conf
Created Jun 28, 2013
Remove file extension from urls's
View remove-extension.conf
<IfModule mod_rewrite.c>
AddType text/x-component .htc
RewriteEngine On
RewriteBase /
# remove .php; use THE_REQUEST to prevent infinite loops
RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP
RewriteRule (.*)\.php$ $1 [R=301]
# remove index
juniovitorino / ievm.zsh
Last active Dec 18, 2015
ZSH Function to download and install Windows and Internet Explorer VirtualBox VM from xdissent ievms project.
View ievm.zsh
function ievm {
curl -s | env IEVMS_VERSIONS="$1" bash
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);
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\.)? [NC]
RewriteRule \.(jpeg|jpg|gif|pdf)$ - [NC,F,L]
You can’t perform that action at this time.