Skip to content

Instantly share code, notes, and snippets.

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

Uilian Souza uilian

🏠
Working from home
View GitHub Profile
@uilian
uilian / oracle-spatial-google-projection.sql
Created May 20, 2014 18:45
Oracle Spatial add Google SRID conversion capability
------------------------------------------------
-- OPTIONAL STEPS
-- Adding Ellipsoid
INSERT INTO MDSYS.SDO_ELLIPSOIDS (
ELLIPSOID_ID,
ELLIPSOID_NAME,
SEMI_MAJOR_AXIS,
UOM_ID,
INV_FLATTENING,
SEMI_MINOR_AXIS,
@uilian
uilian / docker-cleanup.sh
Created January 26, 2018 16:20
Remove unused docker objects
#remove stoped containers
docker rm $(docker ps -a -q)
# remove images without references
docker rmi $(docker images -f "dangling=true" -q)
# remove volumes without references
docker volume rm $(docker volume ls -qf dangling=true)
@uilian
uilian / docker-compose.yml
Created January 24, 2018 10:14
docker-compose nginx
version: '2'
services:
web:
image: nginx:stable-alpine
volumes:
- ./code:/usr/share/nginx/html
ports:
- "8080:80"
environment:
- NGINX_HOST=localhost.com
@uilian
uilian / python-server
Created January 23, 2018 15:38
Python as a HTTP server
# Python has a HTTP server built into the
# standard library. This is super handy for
# previewing websites.
# Python 3.x
$ python3 -m http.server
# Python 2.x
$ python -m SimpleHTTPServer 8000
@uilian
uilian / git diff
Created November 9, 2017 12:43
Git diff between branches
# diff between two branches
git diff [commit id 1] [commit id 2]
# diff between current branch and another
git diff [commit id]
@uilian
uilian / git log graph
Created November 9, 2017 12:41
Better git log graph
git log --all --graph --pretty=format:'%C(auto)%h%C(auto)%d %s %C(dim white)(%aN, %ar)'
@uilian
uilian / files in git commit
Last active November 9, 2017 12:38
List files in git commit
git diff-tree --no-commit-id --name-status -r [commit id]
# The --no-commit-id suppresses the commit ID output.
# The --pretty argument specifies an empty format string to avoid the cruft at the beginning.
# The --name-status argument shows the file names that were affected and the status.
# The -r argument is to recurse into sub-trees
@uilian
uilian / git find file
Created November 9, 2017 12:28
Find file in git history
git log --all --full-history -- [path/file]
@uilian
uilian / index.html
Created October 20, 2017 13:28
Generate browser unique fingerprint
<html>
<head>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.min.js" ></script>
<script type="text/javascript">
@uilian
uilian / genyrun.sh
Last active September 29, 2017 17:37
Run Genymotion emulator
# pass the device name as parameter
GENY_HOME=~/tools/genymotion
$GENY_HOME/player --vm-name $1