Skip to content

Instantly share code, notes, and snippets.

View xy2z's full-sized avatar

Alexander xy2z

View GitHub Profile
alias xy_alias_version='echo xy_alias version 1.42'
alias xy_alias_url='echo https://gist.github.com/xy2z/0dad738b1519aed3f67613a6e9e2917a'
alias xy_alias_update_linux='wget -nv -O ~/.bash_aliases https://gist.githubusercontent.com/xy2z/0dad738b1519aed3f67613a6e9e2917a/raw/.bash_aliases && source ~/.bash_aliases'
alias xy_alias_update_windows='setaliases https://gist.githubusercontent.com/xy2z/0dad738b1519aed3f67613a6e9e2917a/raw/.bash_aliases'
alias ll='ls -alh --show-control-chars -F --color $*'
alias gl='git log --oneline --all --graph --decorate $*'
alias gs='git status $*'
alias gd='git diff'
alias gds='git diff --staged'
@bobbybouwmann
bobbybouwmann / User.php
Last active May 31, 2024 03:04
Laravel Absolute vs Relative Dates with Carbon
<?php
namespace App;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
/**
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

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 
@cowboy
cowboy / github_post_recieve.php
Created October 11, 2010 02:04
GitHub PHP webhook to auto-pull on repo push
<?php
// Use in the "Post-Receive URLs" section of your GitHub repo.
if ( $_POST['payload'] ) {
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' );
}
?>hi