Skip to content

Instantly share code, notes, and snippets.

View sneycampos's full-sized avatar
🏠
Working from home

Silvio Ney sneycampos

🏠
Working from home
  • Portugal
  • 09:58 (UTC +01:00)
View GitHub Profile
@sneycampos
sneycampos / Encryptable.php
Created April 9, 2021 19:31
trait Encryptable laravel
<?php
use Illuminate\Support\Facades\Crypt;
trait Encryptable
{
/**
* Decrypt the column value if it is in the encrypted array.
*
* @param $key
@sneycampos
sneycampos / Ubuntu New Installation.sh
Last active November 29, 2022 10:19
Ubuntu Install
# Terminator
## https://github.com/gnome-terminator/terminator
# unbind default terminal command
# gsettings set org.gnome.settings-daemon.plugins.media-keys terminal '[]'
# Go to Settings -> Devices -> Keyboard and scroll to the end. Press + and you will create custom shortcut.
# Enter name: "terminator", command: /usr/bin/terminator -l "layout-custom"
sudo add-apt-repository ppa:mattrose/terminator
@sneycampos
sneycampos / Docker useful commands
Last active February 2, 2021 22:55
Docker useful commands
## Docker
Find the container: docker ps -a
Delete container: docker rm -v <container_name>
List all images: docker image ls
Delete image by tag: docker image rmi _tag_ --force
Remove unused images: docker image prune --all --force
See space used by docker: docker system df
Remove dangling images: docker rmi $(docker images -f "dangling=true" -q) --force
@sneycampos
sneycampos / infinitescroll.js
Created May 1, 2019 13:06 — forked from amitavroy/infinitescroll.js
This code is used to generate an infinite scroll. It appends the new data to the container. Need to work on providing an animation when the data is being fetched.
$(window).scroll(function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()){
// calling the function to get the ajax data
loadMore();
}
});
function loadMore() {
$.ajax({
url: base_url + "/infscroll/get_inf_scroll_ajax",