Skip to content

Instantly share code, notes, and snippets.

View dody87's full-sized avatar

Dody dody87

View GitHub Profile
@dody87
dody87 / show-me-huge-folders.sh
Created May 21, 2019 13:55
Linux get most heavy folders command line
du -sch .[!.]* * |sort -h
@dody87
dody87 / command_only_show_my_ip_mac
Last active May 4, 2024 09:55
Simple command to show your IP and nothing else on MacOS
# Step 1: open terminal.
# Step 2: nano ~/.bash_profile
# Step 3: Add the following code below
alias my-ip='ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d\ -f2'
# Step 4: save file and restart terminal.
@dody87
dody87 / set_random_profile_image.sql
Created March 31, 2019 15:42
set_random_profile_image.sql
UPDATE user
SET img = REPLACE('https://randomuser.me/api/portraits/men/?.jpg', '?', FLOOR((RAND() * (50-20+1))+20))
@dody87
dody87 / citystategeo.js
Last active February 13, 2020 17:55 — forked from danasilver/citystategeo.js
Get only city and state from Google Maps API Reverse Geocoder
_getCityState = function(resp){
var res = '';
if (resp.status == 'OK') {
if (resp.results[1]) {
var city=false,state=false;
for (var i = 0; i < resp.results.length; i++) {
if ((!city || !state) && resp.results[i].types[0] === "locality") {
city = resp.results[i].address_components[0].short_name,
state = resp.results[i].address_components[2].short_name;
res = city + ", " + state;
@dody87
dody87 / app.css
Created June 26, 2017 00:35
generic empty CSS style sheet for from scratch projects including media queries and print version.
/*========== App CSS here ==========*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
/* Extra Small Devices, Phones */
@media only screen and (min-width : 480px) {
@dody87
dody87 / update_from_forked_repository.sh
Last active May 16, 2017 16:26
script in order to get upstream (parent repository) updated.
#!/bin/bash
echo "Updating upstream forked repository."
git remote add upstream git@GIT_REPOSITORY_URL.git
git fetch upstream
git pull upstream master
echo "Done! :)"
@dody87
dody87 / merge.sh
Created August 18, 2016 14:41
git merge script for many branches. Run sh merge.sh branch1 branch2 ...
branch=$(git symbolic-ref --short -q HEAD)
git pull origin $branch
git push origin $branch
for environment in "$@"
do
echo "Merging environment $environment"
git checkout $environment
git pull origin $environment
git merge $branch
git push origin $environment