Skip to content

Instantly share code, notes, and snippets.

View rafcontreras's full-sized avatar
😟

Rafael Contreras rafcontreras

😟
View GitHub Profile
@rafcontreras
rafcontreras / README.md
Last active June 13, 2023 06:02
Riddle Voting

Instructions

  1. Install Tampermonkey extension for your browser
  2. Copy the code from the Riddle.js file
  3. Go to the Tampermonkey dashboard and click on the [+] button to create a new UserScript
  4. Paste the code
  5. Make sure the script is not Enabled
  6. Go to the Stuff page where the poll is running
  7. Get the option you want to select
  8. Change the desiredOption variable
[
{
"name": "Turkey",
"change": 563,
"flag": "🇹🇷",
"code": "TR",
"initial": 11.86,
"final": 78.62,
"difference": 66.76
},
javascript:(function()%7Bvar%20select2%20%3D%20%7B%0A%20%20js%3A%20%22https%3A%2F%2Fcdnjs.cloudflare.com%2Fajax%2Flibs%2Fselect2%2F4.0.13%2Fjs%2Fselect2.min.js%22%2C%0A%20%20css%3A%0A%20%20%20%20%22https%3A%2F%2Fcdnjs.cloudflare.com%2Fajax%2Flibs%2Fselect2%2F4.0.13%2Fcss%2Fselect2.min.css%22%2C%0A%20%20jquery%3A%20%22https%3A%2F%2Fcdnjs.cloudflare.com%2Fajax%2Flibs%2Fjquery%2F3.6.0%2Fjquery.min.js%22%2C%0A%20%20fuse%3A%20%22https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2Ffuse.js%2Fdist%2Ffuse.js%22%0A%7D%3B%0A%0Afunction%20matchCustom(params%2C%20data)%20%7B%0A%20%20if%20(jQuery.trim(params.term)%20%3D%3D%3D%20%22%22)%20%7B%0A%20%20%20%20return%20data%3B%0A%20%20%7D%0A%20%20if%20(typeof%20data.text%20%3D%3D%3D%20%22undefined%22)%20%7B%0A%20%20%20%20return%20null%3B%0A%20%20%7D%0A%20%20var%20text%20%3D%20data.text.trim()%3B%0A%20%20var%20term%20%3D%20params.term.trim()%3B%0A%20%20var%20array%20%3D%20%5B%7B%20text%3A%20text%20%7D%5D%3B%0A%20%20var%20fuse%20%3D%20new%20Fuse(array%2C%20%7B%0A%20%20%20%20keys%3A%20%5B%22te
@rafcontreras
rafcontreras / getStuffInOrder.js
Created September 8, 2020 01:29
Javascript Map that waits for previous promise before starting next.
const getStuffInOrder = (array) => {
const results = [];
const failed = [];
array
.reduce(
(chain, item) =>
chain.then(() =>
promiseFunction(item)
.then((data) => {
if (data) {
@rafcontreras
rafcontreras / webpack-for-node-modules.js
Created July 21, 2020 02:08 — forked from mxstbr/webpack-for-node-modules.js
How to use webpack to compile node modules
/* eslint-disable no-var */
var path = require('path');
var autoprefixer = require('autoprefixer');
const MATCH_ALL_NON_RELATIVE_IMPORTS = /^\w.*$/i;
module.exports = [{
output: {
filename: '[name].js',
library: 'atrium-react-plugin-beta',
@rafcontreras
rafcontreras / extractCookies.js
Last active May 19, 2020 02:43
Create a cookie array from cookies.txt file
const parseTokens = (tokens) => {
if (tokens.length === 7) {
const domain = tokens[0];
const flag = tokens[1] === "TRUE";
const path = tokens[2];
const secure = tokens[3] === "TRUE";
let expiration = tokens[4];
if (expiration.length === 17) {
expiration = Math.floor(expiration / 1000000 - 11644473600);
}
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%
}
article,
aside,
details,
figcaption,
Set-ExplorerOptions -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
Enable-PSRemoting -Force
Enable-RemoteDesktop
cinst IIS-WebServerRole -source windowsfeatures
cinst IIS-WebServer -source windowsfeatures
cinst IIS-HttpRedirect -source windowsfeatures
Verifying I am +rafacontreras on my passcard. https://onename.com/rafacontreras