Skip to content

Instantly share code, notes, and snippets.

View obedparla's full-sized avatar
👨‍💻
42

Obed Parlapiano obedparla

👨‍💻
42
View GitHub Profile
@mixin transitions($applyTo, $duration) {
-webkit-transition: $applyTo $duration;
-moz-transition: $applyTo $duration;
-o-transition: $applyTo $duration;
transition: $applyTo $duration;
}
@mixin transition-duration($duration) {
-webkit-transition-duration: $duration;
-moz-transition-duration: $duration;
@obedparla
obedparla / lines-removed-bitbucket.js
Last active June 14, 2019 12:47
Get the total amount of lines removed in a bitbucket pull request (PR)
// Paste this on the console in a bitbucket PR
const linesRemovedElements = document.getElementsByClassName('lines-removed')
let totalRemoved = 0;
for(ele of linesRemovedElements){
totalRemoved += Number(ele.innerText)
}
@obedparla
obedparla / clean-kindle-highlights.js
Last active May 14, 2022 14:53
Clean the HTML for the kindle highlights. Make it ready for a blog post with quotation marks and navigation to each header.
// Open the highlights HTML page on your browser and copy this code in the console of the developer tools
// Don't execute part of the script if you want to avoid some of the changes.
// Remove the highlights elements
const highlights = document.querySelectorAll('.m_noteHeading')
for(let highlight of highlights){
highlight.parentNode.removeChild(highlight)
}
// Transform the sectionHeading into h2 elements
@obedparla
obedparla / humanReadableDates.js
Last active November 20, 2019 17:50
Human readable dates
// *** Usage ***
// This will show timeAgo up to 1 week (2 hours ago, 4 days ago, etc) up to a week.
// Leave oneWeek out and the default is 3 days.
const refDate = new Date('Wed Nov 20 2019');
humanReadableDate(new Date(), refDate, oneWeek);
// Same as above but without abreviated months
longHumanReadableDate(refDate)
@obedparla
obedparla / git-config
Last active June 23, 2020 15:55
My personal Git config that must have saved me hundreds of hours over the years.
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[status]
showUntrackedFiles = all
# Sometimes a newly-added folder, since it's only one line in git status, can slip under the radar.
# https://git-scm.com/docs/git-config#git-config-statusshowUntrackedFiles
@obedparla
obedparla / getLocaleDateString.js
Created April 24, 2020 16:06
This function returns the date in a specific format per language in JavaScript
// This function returns the date in a specific format per language
// You can pass the language (or navigator.language for the browser's language)
// Feel free to use the formats alone as well.
function getLocaleDate(lang){
let formats = {
"ar-SA" : "dd/MM/yy",
"bg-BG" : "dd.M.yyyy",
"ca-ES" : "dd/MM/yyyy",
"zh-TW" : "yyyy/M/d",
@obedparla
obedparla / change-youtube-speed-bookmark
Created January 3, 2021 18:42
Change the youtube's video speed to any custom value. Even above 2x!
// Save this as a bookmark's URL and you're done
javascript:(function() {
document.getElementsByTagName("video")[0].playbackRate = prompt("Speed", "2.5");
})();
@obedparla
obedparla / karabiner_rules
Created February 8, 2021 18:18
karabiner_rulessht shtsh
"rules": [
{
"description": "button5 left space",
"manipulators": [
{
"from": {
"pointing_button": "button5"
},
"to": [
{
@obedparla
obedparla / karabiner_rules
Created February 8, 2021 18:18
karabiner_rulessht shtshtsh
"rules": [
{
"description": "button5 left space",
"manipulators": [
{
"from": {
"pointing_button": "button5"
},
"to": [
{
@obedparla
obedparla / karabiner_rules
Created February 8, 2021 18:18
Obed's karabiner rules
"rules": [
{
"description": "button5 left space",
"manipulators": [
{
"from": {
"pointing_button": "button5"
},
"to": [
{