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 index.html
<html lang="en">
<head>
<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>
</head>
<body></body>
</html>
@juniovitorino
juniovitorino / init.sh
Created Jun 29, 2016 — forked from tmiller/init.sh
DigitalOcean ubuntu 14.04 server configuration script.
View init.sh
#!/bin/bash
username="ubuntu"
ssh_pub_key=""
# 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 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 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 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');
@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"
@juniovitorino
juniovitorino / ncenter
Created Nov 12, 2013
Load/Unload OS X Notification Center
View ncenter
# Notification Center
alias ncstop="launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist"
alias ncstart="launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist"
View AppLock.mobileconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDescription</key>
<string>Disables the home button.</string>
<key>PayloadDisplayName</key>
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
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;
}
You can’t perform that action at this time.