Skip to content

Instantly share code, notes, and snippets.

View avataru's full-sized avatar

Mihai Zaharie avataru

View GitHub Profile
@avataru
avataru / animated-link.css
Created July 4, 2018 10:17
Animated hover on links
@avataru
avataru / EloquentCheatSheet.md
Last active April 5, 2024 20:39
Eloquent relationships cheat sheet
@avataru
avataru / Bitmask.php
Created August 24, 2016 09:05
Bitmask class
class Bitmask
{
private $bitmask;
public function __construct($bitmask = 0)
{
$this->bitmask = $bitmask;
}
public function set($bit, $value)
@avataru
avataru / General.md
Last active August 29, 2015 14:26
Awesome resources
@avataru
avataru / Util.php
Created April 15, 2015 14:44
Check link validity
Class Util
{
/**
* Validates the given Link is broken or not
*
* Prerequisite
* - cUrl
*
* Conditions:
* - Valid if HTTP Status in (200,301, 302, 303, 307)
@avataru
avataru / Aliases-GIT.md
Last active August 29, 2015 14:15
Git aliases

Better log
Usage: git lg (see log) or git lg -p (see changed lines)

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

Undo last commit (not pushed)
Usage: git undo

git config --global alias.undo "reset --soft HEAD~1"
# https://github.com/ericboehs/dotfiles/tree/master/shell/aliases
alias yolo='git commit -am "DEAL WITH IT" && git push -f origin master'
alias sedit="gksudo gedit"
alias clean-boot="apt-get remove `dpkg --list 'linux-image*' |grep ^ii | awk '{print $2}'\ | grep -v \`uname -r\``"
@avataru
avataru / list-folders.bat
Created November 14, 2014 14:38
List sub-folders in location
ECHO OFF
CLS
SET /P D=Choose the folder (ex.: g:\my folder):
ECHO.
DIR "%D%" /A:D-H-S /B /O:N > %USERPROFILE%\Desktop\Folders.txt
@avataru
avataru / sass-watch.bat
Last active August 29, 2015 14:09
SASS watcher
@ECHO OFF
CHOICE /C:NXCO /N /T:5 /D:C /M:"Output [N]ested, E[x]panded, [C]ompact or C[o]mpressed?"
SET ZONE=%ERRORLEVEL%
CLS
IF %ZONE% EQU 1 GOTO :Nested
IF %ZONE% EQU 2 GOTO :Expanded
IF %ZONE% EQU 3 GOTO :Compact
IF %ZONE% EQU 4 GOTO :Compressed
:Nested