Skip to content

Instantly share code, notes, and snippets.

View fmaylinch's full-sized avatar

Ferran Maylinch fmaylinch

View GitHub Profile
/**
* This is an example of a basic node.js script that performs
* the Client Credentials oAuth2 flow to authenticate against
* the Spotify Accounts.
*
* For more information, read
* https://developer.spotify.com/web-api/authorization-guide/#client_credentials_flow
*/
var request = require('request'); // "Request" library
@fmaylinch
fmaylinch / Code cheat sheet.md
Last active October 28, 2022 22:54
Common lines of code in different languages for quick reference and comparison
fade("#title", "Привет!")
fade("#text1", "Вот " + link("песня", "https://disk.yandex.ru") + " я написал для тебя")
fade("#text2", "Пожалуйста скажи как тебе)")
@fmaylinch
fmaylinch / fmaylinch.github.io-code.js
Last active March 3, 2024 23:09
Code to execute in fmaylinch.github.io
$('#main-button').click(); // click the "MAIN" button (scrolls up)
setTimeout(changeTexts, 1000); // run after 1 second (to give time to scrolling)
function changeTexts() {
fade("#title", "Practice coding")
const action = random(["try", "run", "execute", "modify"])
const js = link("JavaScript", "https://developer.mozilla.org/docs/Web/JavaScript")
fade("#text1", "You can " + action + " the " + js + " code below")
const functions = join(["fade", "join", "link", "random"]);
@fmaylinch
fmaylinch / arkham-horror.js
Last active March 17, 2024 16:40
Arkham Horror for fmaylinch.github.io
let version = "v0.5.12 token color";
$("#main").css({padding: "0.5em"});
//$('#main-button').click();
let tokens = [
'+1',
0, 0, -1, -1, -1, -2, -2,
-3, -4,
"Skull", "Skull", "Cape",
<!DOCTYPE html>
<html>
<head>
<style>
#map {
height: 400px;
width: 100%;
}
#searchTextField {
// This code is displays a counter above.
// The code is transpiled with Babel and run with eval().
const { useState } = React; // imports don't work here
function Counter() {
const [count, setCount] = useState(0);
return (
<div style={{margin: 20}}>
// import React from 'react' // imports don't work here
const tokens = [
"+1", 0, 0, -1, -1, -1,
-2, -2, -3, -4,
"💀", "💀", "🧙", "🦑", "🌟"
];
function diceMessageGenerator(value) {
switch (value) {