Skip to content

Instantly share code, notes, and snippets.

View nailton's full-sized avatar

Nailton nailton

View GitHub Profile
@nailton
nailton / scroll-animate.js
Created March 6, 2019 19:45
scroll-animate
$("a[href^='#']").click(function(e) {
e.preventDefault();
var position = $($(this).attr("href")).offset().top;
$("body, html").animate({
scrollTop: position
} /* speed */ );
});
@nailton
nailton / move.sh
Created February 15, 2019 16:14
Move public folder
rm -rf public_html/ #delete
ln -s /home/my-user-wherever/site/public/ public_html #symlink
@nailton
nailton / run.sh
Created February 4, 2019 13:48
RUN composer install in hostgator with php 7.1
/opt/php71/bin/php /opt/cpanel/composer/bin/composer install
<?php
// Get Base URI
$baseUri = str_replace($_SERVER['DOCUMENT_ROOT'], '', dirname($_SERVER['SCRIPT_FILENAME']));
$http = str_replace(array('/', '\\'), '/', $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . $baseUri . '/');
$catalog = explode('/', $http);
array_pop($catalog);
array_pop($catalog);
$catalog = implode('/', $catalog) . '/';
@nailton
nailton / zipAll.sh
Created November 26, 2018 18:34
ZIP_ALL_FOLDERS WITH DATE
for i in */; do zip -r "${i%/}-`date '+%d-%m-%Y'`.zip" "$i"; done
@nailton
nailton / php7.1
Created August 6, 2018 14:13
PHP 7.1 Locaweb via htaccess
##### LOCAWEB - NAO REMOVER #####
AddHandler php71-script .php
suPHP_ConfigPath /home/yourPath/
##### LOCAWEB - NAO REMOVER #####
@nailton
nailton / command.sh
Created December 13, 2017 12:53
Permission sever chmod
cd /var/www/image
#For file like image you don't need execution permission :
sudo chmod 664 *
#If you have directories inside image and you want to apply permission :
sudo find . -type d -exec chmod 755 "{}" \;
#This will recursively search your directory and chmod 755 all directories only.
@nailton
nailton / vhost-nginx.sh
Last active December 12, 2017 01:50
vhost-nginx
#!/usr/bin/env bash
# Run this as sudo!
# I move this file to /usr/local/bin/vhost and run command 'vhost' from anywhere, using sudo.
#
# Show Usage, Output to STDERR
#
function show_usage {
cat <<- _EOF_
@nailton
nailton / softwareProCmm.sh
Created January 4, 2017 15:52
Conseguir fazer coisas como: "sudo add-apt-repository"
sudo apt-get install python-software-properties && software-properties-common
@nailton
nailton / colority.js
Last active December 22, 2016 18:15
Colorindo infinitamente alguma class, titulo e etc.
var css = document.getElementsByClassName("esg-click-to-play-video");
var y = 0;
var x = 0;
function colority() {
if (css[x] != null) {
css[x].style.background = cores[y];
}
x++;
y++;
if (y > cores.length) {