Skip to content

Instantly share code, notes, and snippets.

Uilian Souza uilian

Block or report user

Report or block uilian

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@uilian
uilian / python-server
Created Jan 23, 2018
Python as a HTTP server
View python-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 Nov 9, 2017
Git diff between branches
View git diff
# 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 Nov 9, 2017
Better git log graph
View 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 Nov 9, 2017
List files in git commit
View 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 Nov 9, 2017
Find file in git history
View git find file
git log --all --full-history -- [path/file]
@uilian
uilian / index.html
Created Oct 20, 2017
Generate browser unique fingerprint
View index.html
<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 Sep 29, 2017
Run Genymotion emulator
View genyrun.sh
# pass the device name as parameter
GENY_HOME=~/tools/genymotion
$GENY_HOME/player --vm-name $1
@uilian
uilian / avds.sh
Created Sep 26, 2017
Shows a list of all avds and let you select on by the index.
View avds.sh
#!/bin/bash
# you android_home, something like '/home/user/Android/Sdk/'
cd $ANDROID_HOME
./tools/emulator -list-avds | cat -n
printf "Select AVD: "
read index
avd=$(./tools/emulator -list-avds | sed "${index}q;d")
echo "Selected $avd"
./tools/emulator -netdelay none -netspeed full -avd $avd
@uilian
uilian / dev-menu.sh
Created Sep 23, 2017
Activate React-Native Dev Menu
View dev-menu.sh
#!/bin/bash
adb shell input keyevent KEYCODE_MENU
@uilian
uilian / Sync
Created Sep 8, 2017
Synchronize time between host and container
View Sync
You can add your local files (/etc/timezone and /etc/localtime) as volume in your docker-container.
Update your docker-compose.yml with the following lines.
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
Now the container time is the same as on your host
You can’t perform that action at this time.