Skip to content

Instantly share code, notes, and snippets.

@Olousouzian
Olousouzian / site.sh
Created September 21, 2016 06:25
Site.sh - script
#!/bin/bash
# alias site=". /Users/Olousouzian/Applications/site.sh"
if [[ $# -gt 0 ]]; then
cd /Users/Olousouzian/Sites/$1 && ls -la
else
cd /Users/Olousouzian/Sites && ls -la
fi
@Olousouzian
Olousouzian / gitdate.sh
Created May 9, 2016 15:13
List GIT branches by update date
#!/bin/bash
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r | less
@Olousouzian
Olousouzian / symfony-tail-dev-color.sh
Created May 9, 2016 15:11
Symfony tail -f color synthax.
tail -f app/logs/dev.log | awk '
/(request|app)\.INFO/ {print "\033[36m" $0 "\033[39m"}
/(request|app)\.WARNING/ {print "\033[33m" $0 "\033[39m"}
/(request|app)\.ERROR/ {print "\033[31m" $0 "\033[39m"}
/(request|app)\.CRITICAL/ {print "\033[31m" $0 "\033[39m"}
'
@Olousouzian
Olousouzian / importCSV.sql
Created May 9, 2016 15:10
Import CSV file with Mysql CLI
-- This following script / snippets can be used for import CSV file directly into MySQL
-- Advantages : very very fast (15.000.000 lines --> ~5min)
-- First use mysql cli binary with local-infile flag
-- mysql --local-infile -uThisisusername -pGreatPassword database
-- Clear table if you need to
TRUNCATE TABLE big_tables_numbers;