Skip to content

Instantly share code, notes, and snippets.

View rafaelcastrocouto's full-sized avatar
🏳️‍🌈
hi!

@racascou rafaelcastrocouto

🏳️‍🌈
hi!
View GitHub Profile
{
"data": {
"weatherObservation": {
"stationName": "Artic Station",
"windSpeed": 42,
"temperature": -13.55,
"windDirection": 216
}
},
"status": {
{
"data": {
"ocean": {
"name": "Artic Ocean"
}
},
"status": {
"name": "ok"
}
}
{
"data": {
"sunrise": "6:00",
"sunset": "18:00",
"countryName": "Artic",
"timezoneId": 123,
"time": 1642628844059
},
"status": {
"name": "ok"
@rafaelcastrocouto
rafaelcastrocouto / index.html
Created July 20, 2021 23:18
Number of non zero digits in 2^n base 3
<canvas></canvas>
<a href="https://oeis.org/A130693">Related OEIS decription</a>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.4.1/chart.min.js"></script>
<script>
const n = 1000;
var data=[], powers=[], labels=[];
for (let x=2; x<n; x++) {
let p = BigInt(Math.pow(2,x));
@rafaelcastrocouto
rafaelcastrocouto / show_emoji.js
Last active April 16, 2020 15:52
Decodes xn-- domains to show their emojis on https://www.namebase.io/domains/
/* punycode*/ !function(e){function o(e){throw new RangeError(T[e])}function n(e,o){for(var n=e.length,r=[];n--;)r[n]=o(e[n]);return r}function r(e,o){var r=e.split("@"),t="";r.length>1&&(t=r[0]+"@",e=r[1]),e=e.replace(S,".");var u=e.split("."),i=n(u,o).join(".");return t+i}function t(e){for(var o,n,r=[],t=0,u=e.length;u>t;)o=e.charCodeAt(t++),o>=55296&&56319>=o&&u>t?(n=e.charCodeAt(t++),56320==(64512&n)?r.push(((1023&o)<<10)+(1023&n)+65536):(r.push(o),t--)):r.push(o);return r}function u(e){return n(e,function(e){var o="";return e>65535&&(e-=65536,o+=P(e>>>10&1023|55296),e=56320|1023&e),o+=P(e)}).join("")}function i(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:b}function f(e,o){return e+22+75*(26>e)-((0!=o)<<5)}function c(e,o,n){var r=0;for(e=n?M(e/j):e>>1,e+=M(e/o);e>L*C>>1;r+=b)e=M(e/L);return M(r+(L+1)*e/(e+m))}function l(e){var n,r,t,f,l,s,d,a,p,h,v=[],g=e.length,w=0,m=I,j=A;for(r=e.lastIndexOf(E),0>r&&(r=0),t=0;r>t;++t)e.charCodeAt(t)>=128&&o("not-basic"),v.push(e.charCodeAt(t));for(f=r>0?r+1:0;g>f;)
@rafaelcastrocouto
rafaelcastrocouto / gist:612dc07b1db3b357212be6eab326e0ab
Created March 23, 2020 11:23
Remove watched from Youtube subscriptions feed
var vids = document.querySelectorAll('ytd-thumbnail-overlay-resume-playback-renderer');
for (prog of vids) {
prog.parentElement.parentElement.parentElement.parentElement.parentElement.style.display = 'none';
}
@rafaelcastrocouto
rafaelcastrocouto / twitteradblock.js
Last active October 14, 2018 00:50
Twitter Ad Block
console.log('twitter ad block');
var clear = function () {
document.querySelectorAll('svg + div').forEach(function (a) {
if(a.textContent.search('Promoted') > -1) {
var p = a;
for(var c=0; c<7; c++){
if (p.tagName == 'A' && p.classList.contains('rn-1loqt21 ')) break;
p = p.parentElement;
}
if (p.classList.contains('rn-qklmqi') || p.classList.contains('rn-1loqt21 ')) {

Keybase proof

I hereby claim:

  • I am rafaelcastrocouto on github.
  • I am racascou (https://keybase.io/racascou) on keybase.
  • I have a public key whose fingerprint is 39A9 CAD1 C084 C377 C128 FEA9 2553 A8AA BF6A ADCC

To claim this, I am signing this object:

@rafaelcastrocouto
rafaelcastrocouto / gist:679cc0506c94ebd5809a
Created October 21, 2014 18:14
jQuery Preload CSS Images
jQuery.preloadCssImages = function(){
var allImgs = [];//new array for all the image urls
var k = 0; //iterator for adding images
var sheets = document.styleSheets;//array of stylesheets
for(var i = 0; i<sheets .length; i++){//loop through each stylesheet
var cssPile = '';//create large string of all css rules in sheet
var csshref = (sheets[i].href) ? sheets[i].href : 'window.location.href';
@rafaelcastrocouto
rafaelcastrocouto / keybase.md
Created September 24, 2014 12:47
keybase.md

Keybase proof

I hereby claim:

  • I am rafaelcastrocouto on github.
  • I am racascou (https://keybase.io/racascou) on keybase.
  • I have a public key whose fingerprint is 6998 8430 0FE8 9856 8CF4 8588 36BA D5EC 8608 60B2

To claim this, I am signing this object: