Skip to content

Instantly share code, notes, and snippets.

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

Jose Ramon Aleman jraleman

🏠
Working from home
View GitHub Profile
@jraleman
jraleman / jsx-to-js.sh
Created October 7, 2019 01:17
Convert extension files jsx to js
find . -name '*.jsx' -exec sh -c 'mv "$0" "${0%.jsx}.js"' {} \;
@jraleman
jraleman / git-change-commit-messages.md
Created August 12, 2019 20:07 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@jraleman
jraleman / tortugon.sh
Created July 23, 2019 22:31
Don't run this!
#!/bin/sh
🐢(){🐢|🐢&};🐢
@jraleman
jraleman / resume.md
Last active July 9, 2019 00:04
A brief resume in Markdown

Jose Ramon Aleman

Software Engineer

Contact Info

Address  : 6600 Dumbarton Cir, Fremont, CA 94555  
Phone    : 863-738-9740 
Email    : jraleman@bendiburg.com  
Linkedin : linkedin.com/in/jraleman/  
@jraleman
jraleman / swap.sh
Created November 22, 2018 01:39
Swap two file from one location to another location
#!/bin/sh
if [ $# -ne 2 ] ; then
echo "usage: $0 source_file target_file" ;
exit 1 ;
else
[ -e $1 ] && [ -e $2 ]
tmp=$(mktemp)
mv -fv $1 $tmp
mv -fv $2 $1
echo -e '#include<stdio.h>\nint main(){return(printf("NNNNmmmNNNNNNNNNNNNNNNNNNmhyysyssosysyyyys++s+//+++//::::/+osyyshNNNNNNNNNNmNNNNNNNNNNNNNNNNNNNmNNmm\\nNNNNNNNNNNNNNNNNNNNNNNNNmsssoooooossssooo++s+///::::-----::/++osshmNNNNNNNNNNNNNNNNNNNNNNNNNmNNNmmmm\\nNNNNNNNNNNNNNNNNNNNNNNNNyosoooo+osso+o++/+//::::----:----::://+oooymNNNNNNNNNNNNNNNNNNNNNNNNNmmNmmmN\\nNNNNNNNNNNNNNNNNNNNNNNNdo+o++o+oso++o++++/////++//+//:--:://ossssossdNNNNNNNNNNNNNNNNNNNNNNNNNNmNNNN\\nNNNNNNNNNNNNNNNNNNNNNNNs++///+++o+ssssyssooossyyyyyyyso+oosyhhdmmdyysdNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN\\nNNNNNNNNNNNNNNNNNNNNNNd///://://++syhdddhyhhhhyyyyyyyyyysyyyhhhdmmdhhsmNNNNNNNNNNNNNNNNNNNNNNNNNNNNm\\nNNNNNNNNNNNNNNNNNNNNNNy:-:-::://+++sdddddhhhyyyyyyyyyyyyyyyyyyhhhddhhsdNNNNNNmNNNmNNNNNmNNNNNNNNNNNm\\nNNNNNNNNNNNNNNNNNNNNNNs--:-:::////+shddhhhhhyssssyyyyyyyyyyyyyyyhhhhhhyNNNNNNmNNNmmmNNNNNNNNNNNNNNNN\\nNNNNNNNNNNNNNNNNNNNNNNo-:--:::://++sshhyyyyssoososssyyyysssyyyssyyyhhhomNNNNNNNNNNNNNNNNNNNNNNNNNNNN\\nNNNNNNNNNNNNNNNNNNNNNNs:----:////+osyyhyyss
@jraleman
jraleman / fix_permissions.sh
Created September 27, 2018 10:57
Fix files and directories permissions
#!/bin/sh
# Source: https://odd.blog/2013/11/05/fix-file-644-directory-775-permissions-linux-easily/
# For directories only do this.
find . -type d -exec chmod 775 {} \;
# For files only do this.
find . -type f -exec chmod 644 {} \;
@jraleman
jraleman / repo-reset.md
Created September 27, 2018 04:31 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@jraleman
jraleman / git-change-author.sh
Last active October 12, 2020 16:54
Script to change git commits' author
#!/bin/sh
# Usage message if number of arguments are invalid.
if [ "$#" -ne 3 ] ; then
echo "usage: sh $0 wrong-email new-email new-name"
exit 1
fi
# Save args to variables.
WRONG_EMAIL="$1"
@jraleman
jraleman / parseLoginTime.js
Last active June 17, 2018 03:41
JavaScript file to parse login time
// from API or anywhere
const dateString = "2018-05-20 08:06:12";
// add plural to string (hour -> hours) if val > 1
function formatLoginTime(val, str) {
return (val.toString() + ' ' + ((val > "1") ? str : str.slice(0, -1)));
}
// pastTime - currentTime
function getDeltaTime(str) {