Skip to content

Instantly share code, notes, and snippets.

View julien-f's full-sized avatar

Julien Fontanet julien-f

View GitHub Profile
@yelouafi
yelouafi / algebraic-effects-series-1.md
Last active February 24, 2024 16:03
Operational Introduction to Algebraic Effects and Continuations

Algebraic Effects in JavaScript part 1 - continuations and control transfer

This is the first post of a series about Algebraic Effects and Handlers.

There are 2 ways to approach this topic:

  • Denotational: explain Algebraic Effects in terms of their meaning in mathematics/Category theory
  • Operational: explain the mechanic of Algebraic Effects by showing how they operate under a chosen runtime environment

Both approaches are valuables and give different insights on the topic. However, not everyone (including me), has the prerequisites to grasp the concepts of Category theory and Abstract Algebra. On the other hand, the operational approach is accessible to a much wider audience of programmers even if it doesn't provide the full picture.

@zpao
zpao / 0-NaiveQRCode.js
Last active June 10, 2018 01:20
Making QRCodes with SVG smaller (using React)
// This will generate 31329 <rect>s for a level 40 QR Code (177x177).
// This approach is totally fine in <canvas> (but should learn from Smarter impl below)
// Lorem Ipsum test content was ~2MB
class QRCodeSVG extends React.Component<Props> {
render() {
var {value, size, level, bgColor, fgColor} = this.props;
var qrcode = new QRCodeImpl(-1, ErrorCorrectLevel[level]);
qrcode.addData(value);
qrcode.make();

tracked npm

@tracked is a decorator for Preact that makes working with state values no different than properties on your component instance.

It's one 300 byte function that creates a getter/setter alias into state/setState() for a given key, with an optional initial value. The "magic" here is simply that it works as a property decorator rather than a function, so it appears to integrate directly into the language.

tracked has no dependencies and works with any component implementation that uses this.state and this.setState().

Installation

@logrusorgru
logrusorgru / mysql.sql
Last active January 16, 2024 07:01
SQL: uniqueness, automatic created_at, updated_at refresh + soft delete. SQLite, PostgreSQL, MySQL
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
-- mysql --
-- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- mysql <http://sqlfiddle.com/#!9/91afb5/2>
-- note: sqlfiddle is very stupid
@thbkrkr
thbkrkr / gist:77d35477095ec91724cc
Created December 17, 2014 16:01
Google Hangouts easter eggs
/bikeshed # changes the color background for everyone
/shydino # a little shy dino shows up
/pitchforks # angry mob running across the chat
/ponies # a pony running across the chat
/ponystream # ponies running across the chat (only local)
konami cheat # changes your local background
yay!!
happy birthday
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active May 20, 2024 06:34
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@sebmarkbage
sebmarkbage / Move.md
Last active August 29, 2015 14:01
Object Rest Destructuring and Spread Initializer (ES7 proposal)
@tdd
tdd / Apprendre JS correctement.md
Last active January 26, 2024 17:48
Quelques ressources valables pour (ré)apprendre JS correctement
@tdd
tdd / conf-best-practices.markdown
Last active March 23, 2020 18:03
A list of best-practices for conference organizers. Especially useful for first-time organizers, I guess.

Website

Things your website should clearly state / make accessible:

  • The core focus of your conf
  • Your core values
  • The (precise) location
  • The dates
  • Your programme, complete with speakers and their bios/pics
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark