Skip to content

Instantly share code, notes, and snippets.

View Frulko's full-sized avatar
🦁

Guillaume Dumoulin Frulko

🦁
View GitHub Profile
@Frulko
Frulko / json-ld.js
Created June 24, 2024 13:40 — forked from hubgit/json-ld.js
Fetch, extract, parse, expand, frame and compact JSON-LD
const { JSDOM } = require('jsdom')
const { compact, expand, frame } = require('jsonld')
const url = 'https://www.bbc.co.uk/schedules/p00fzl6p/2020/06/14'
// fetch and parse HTML
const { window: { document } } = await JSDOM.fromURL(url)
// select the script elements containing JSON-LD
const elements = document.querySelectorAll('script[type="application/ld+json"]')
@Frulko
Frulko / README.md
Created June 29, 2023 14:40
Valet proxy for PHP and Composer commands inside isolated sites

Valet proxy commands

Instruction

  • Copy the file valetproxy.php inside your computer
  • rename as valetproxy
  • chmod u+x valetproxy
  • mv valetproxy /usr/local/bin/ (like composer installation process)
  • edit your ~/.zshrc, ~/.bash_profile
  • add these following lines
export type Obj = Record<any, any>;
export const isArray = Array.isArray;
export const isObject = (val: unknown): val is Obj => {
return val !== null && typeof val === 'object';
};
export type StrapiAttributesObject = {
attributes: any;
@Frulko
Frulko / pi_mount_usb.md
Created November 29, 2022 15:39 — forked from etes/pi_mount_usb.md
How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.

These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.

Step 0. Plug in your USB HDD / Drive to Raspberry Pi If you are using a NTFS formatted drive, install the following

@Frulko
Frulko / settings.json
Created November 15, 2022 15:02
vscode - settings
{
"editor.tabSize": 2,
"editor.renderWhitespace": "all",
"files.associations": {
// "*.twig": "html",
// "*.html": "twig",
"*.module": "php"
},
"workbench.colorTheme": "Dracula",
"scss.validate": false,
@Frulko
Frulko / coin_acceptor.ino
Created August 10, 2022 15:38
Coin Acceptor
const int coinSelector = A1; // Analog input pin that the coin selector uses
int signalValue = 0; // For storing value from analog input
int signalPreviousValue = 0;
int offsetTrigger = 80;
int pulseCounter = 0;
bool hasTriggered = false;
@Frulko
Frulko / new-mac.md
Created July 28, 2022 14:24 — forked from alanzeino/new-mac.md
New Mac Setup

All the stuff I do to set up a new Mac

Applications

  • 1Blocker
  • AirBuddy
  • Amphetamine
  • BlockBlock
  • DaisyDisk
  • Deliveries
  • Fantastical
  • HextEdit
@Frulko
Frulko / ssr.md
Created April 19, 2022 14:02 — forked from Widdershin/ssr.md
The absurd complexity of server-side rendering

In the olden days, HTML was prepared by the server, and JavaScript was little more than a garnish, considered by some to have a soapy taste.

After a fashion, it was decided that sometimes our HTML is best rendered by JavaScript, running in a user's browser. While some would decry this new-found intimacy, the age of interactivity had begun.

But all was not right in the world. Somewhere along the way, we had slipped. Our pages went uncrawled by Bing, time to first meaningful paint grew faster than npm, and it became clear: something must be done.

And so it was decided that the applications first forged for the browser would also run on the server. We would render our HTML using the same logic on the server and the browser, and reap the advantages of both worlds. In a confusing series of events a name for this approach was agreed upon: Server-side rendering. What could go wrong?

In dark rooms, in hushed tones, we speak of colours.

@Frulko
Frulko / index.css
Created April 3, 2022 09:59
CSS - FTP better display urls
tr td:nth-child(2) a{
font-size: 0;
}
tr td:nth-child(2) a::after{
content: attr(href);
font-size: 16px;
}
@Frulko
Frulko / .block
Created March 21, 2022 13:36 — forked from schluppeck/.block
ggplot + crosshatching
license: mit