Skip to content

Instantly share code, notes, and snippets.

@betojsx
betojsx / android-studio.md
Last active June 17, 2019 17:46
How to install Android Studio
@betojsx
betojsx / obfuscate.php
Created June 2, 2019 03:14 — forked from levelsio/obfuscate.php
WordPress plugin to progressively obfuscate text like MAKEbook.io
/*
--PIETZ OBFUSCATE CODE--
2019-06-01
from MAKEbook.io
Instructions:
1) put this in your functions.php file
2) add this to the post you want to obfuscate, on top
3) [obfuscate]
4) to start obfuscating, add a HTML code or HTML block with <start></start>
@betojsx
betojsx / wordpress-permissions.sh
Created April 6, 2019 04:24
Correct WordPress Folders / Files Permissions
chown $USER:www-data -R *
find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 644 {} \; # Change file permissions rw-r--r--
@betojsx
betojsx / gist:81d9e1770a6202f2f4bc61af1a7281e9
Created September 12, 2018 14:13
Debounce Function in good old Vanilla JavaScript
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
@betojsx
betojsx / removePrefixClass.js
Last active December 4, 2017 02:36
Remove Classes if have Prefix / Match your String Vanilla JavaScript
var prefix = "prefix";
var classes = el.className.split(" ").filter(function(c) {
return c.lastIndexOf(prefix, 0) !== 0;
});
el.className = classes.join(" ").trim();
@betojsx
betojsx / coordinatestoname.js
Created December 1, 2017 12:55 — forked from AmirHossein/coordinatestoname.js
Get City and Country name by coordinates via Google Maps api
// Demo: http://jsfiddle.net/1yom6brx/1/
var latlng;
latlng = new google.maps.LatLng(40.730885, -73.997383); // New York, US
//latlng = new google.maps.LatLng(37.990849233935194, 23.738339349999933); // Athens, GR
//latlng = new google.maps.LatLng(48.8567, 2.3508); // Paris, FR
//latlng = new google.maps.LatLng(47.98247572667902, -102.49018710000001); // New Town, US
//latlng = new google.maps.LatLng(35.44448406385493, 50.99001635390618); // Parand, Tehran, IR
//latlng = new google.maps.LatLng(34.66431108560504, 50.89113940078118); // Saveh, Markazi, IR
@betojsx
betojsx / custom-post-type-in-author-archive
Last active July 14, 2022 15:46
Display Custom Post Type in Author Archive WordPress
// In functions.php, add:
<?php
function post_types_author_archives($query) {
if ($query->is_author)
// Add 'books' CPT and the default 'posts' to display in author's archive
$query->set( 'post_type', array('books', 'posts') );
remove_action( 'pre_get_posts', 'custom_post_author_archive' );
}

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

# Instalação do MYSQL, Ubuntu 16.04
sudo apt-get install mysql-server
mysql -u root -p
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'username'@'localhost';