Skip to content

Instantly share code, notes, and snippets.

Gustavo Straube straube

Block or report user

Report or block straube

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
@wybiral
wybiral / noscript-tracking.go
Last active May 20, 2019
Tracking cursor position in real-time with remote monitoring (without JavaScript)
View noscript-tracking.go
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active May 18, 2019
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64
View clean-up-boot-partition-ubuntu.md

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
View open-chrome-tabs-in-safari.scpt
tell application "Google Chrome"
set tab_list to every tab in the front window
repeat with the_tab in tab_list
set the_url to the URL of the_tab
tell application "Safari" to open location the_url
end repeat
end tell
@paneq
paneq / page.conf
Created Apr 3, 2013
nginx maintenance page that is JSON friendly
View page.conf
if (-f $document_root/system/maintenance.html) {
return 503;
}
error_page 503 @maintenance;
location @maintenance {
internal;
if ($http_accept ~ json) {
return 503 "{}";
}
@guisehn
guisehn / gist:3276302
Created Aug 6, 2012
Validar CNPJ (PHP)
View gist:3276302
<?php
function validar_cnpj($cnpj)
{
$cnpj = preg_replace('/[^0-9]/', '', (string) $cnpj);
// Valida tamanho
if (strlen($cnpj) != 14)
return false;
You can’t perform that action at this time.