Skip to content

Instantly share code, notes, and snippets.

View jalbam's full-sized avatar
💗
Coding...

Joan Alba Maldonado jalbam

💗
Coding...
View GitHub Profile
@jalbam
jalbam / performance.now-polyfill.js
Last active November 27, 2022 06:27
window.performance.now polyfill
'use strict';
// @license http://opensource.org/licenses/MIT
// copyright Paul Irish 2015
// Added code by Aaron Levine from: https://gist.github.com/Aldlevine/3f716f447322edbb3671
// Some modifications by Joan Alba Maldonado.
// as Safari 6 doesn't have support for NavigationTiming, we use a Date.now() timestamp for relative values
// if you want values similar to what you'd get with real perf.now, place this towards the head of the page
// but in reality, you're just getting the delta between now() calls, so it's not terribly important where it's placed
// Gist: https://gist.github.com/jalbam/cc805ac3cfe14004ecdf323159ecf40e
@jalbam
jalbam / requestAnimationFrame-polyfill.js
Last active February 5, 2024 01:10
window.requestAnimationFrame polyfill (with high resolution timing, very precise)
'use strict';
// requestAnimationFrame polyfill by Erik Möller.
// Fixes from Paul Irish, Tino Zijdel, Andrew Mao, Klemen Slavic, Darius Bacon and Joan Alba Maldonado.
// Adapted from https://gist.github.com/paulirish/1579671 which derived from
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// Added high resolution timing. This window.performance.now() polyfill can be used: https://gist.github.com/jalbam/cc805ac3cfe14004ecdf323159ecf40e
// MIT license
// Gist: https://gist.github.com/jalbam/5fe05443270fa6d8136238ec72accbc0
@jalbam
jalbam / unfollow-non-followers-twitter.js
Last active September 1, 2024 08:19
Code to stop following those ones who are not following you back on Twitter and keeping those you want or follow anyone you want, with certain filters (working in July 2019)
/*
Unfollow (stop following) those people who are not following you back on Twitter (or unfollow everyone if desired).
This will work for new Twitter web site code structure (it was changed from July 2019, causing other unfollow-scripts to stop working).
Instructions:
1) The code may need to be modified depending on the language of your Twitter web site:
* For English language web site, no modification needed.
* For Spanish language web site, remember to set the 'LANGUAGE' variable to "ES".
* For another language, remember to set the 'LANGUAGE' variable to that language and modify the 'WORDS' object to add the words in that language.
@jalbam
jalbam / print-usernames-twitter.js
Last active February 26, 2024 16:54
Code to show usernames of people you are following on Twitter, being able to choose certain filters to skip some users (and even skip followers or non-followers)
/*
Show user names of people you are following on Twitter, being able to choose certain filters to skip some users (and even skip followers or non-followers).
This will work for new Twitter web site code structure (it was changed from July 2019).
Instructions:
1) The code may need to be modified depending on the language of your Twitter web site:
* For English language web site, no modification needed.
* For Spanish language web site, remember to set the 'LANGUAGE' variable to "ES".
* For another language, remember to set the 'LANGUAGE' variable to that language and modify the 'WORDS' object to add the words in that language.
@jalbam
jalbam / vbs-asks-masked-password
Last active December 8, 2020 19:53
Visual Basic Script (VBS) which asks for the password, being masked (not displaying typed characters), and stores it into a variable (working on Windows 10)
' Visual Basic Script (VBS) which asks for the password, being masked (not displaying typed characters), and stores it into a variable (working on Windows 10).
' * Gist by Joan Alba Maldonado: https://gist.github.com/jalbam/a24edff03fee1241e98dce8c86f8968e
' Asks for the password:
Set WshShell = CreateObject("WScript.Shell")
powerShellCommand = "powershell -noprofile -command " & _
"$passwordEncrypted = Read-Host -assecurestring ""Please, enter your password"";" & _
"$passwordBinary = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($passwordEncrypted);" & _
"$password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($passwordBinary);" & _
"write-output $password"