Skip to content

Instantly share code, notes, and snippets.

View clessg's full-sized avatar

Chris Gaudreau clessg

  • Moncton, Canada
View GitHub Profile
@brainlid
brainlid / index.ex
Last active November 14, 2023 17:23
Example files for a LiveView blog post that starts an async Task to perform work and send message back to the LiveView. https://fly.io/phoenix-files/star-cross-live-view-processes/
defmodule MyAppyWeb.TaskTestLive.Index do
use MyAppWeb, :live_view
require Logger
@impl true
def mount(_params, _session, socket) do
# Trap exits to catch when a Task is forcibly cancelled.
Process.flag(:trap_exit, true)
socket =
@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@mjackson
mjackson / app.js
Created December 29, 2015 05:07
Using webpack with pixi.js
var PIXI = require('pixi.js')
console.log(PIXI)
@ohanhi
ohanhi / joy-of-composition.md
Last active February 3, 2021 18:14
The Joy of Composition - Why stateless rendering is pure bliss

This is a proposal for a lightning talk at the Reactive 2015 conference.

NOTE: If you like this, star ⭐ the Gist - the amount of stars decides whether it makes the cut!

The Joy of Composition

Why stateless rendering is pure bliss

React just got stateless components, meaning that they are in essence pure functions for rendering. Pure functions make it dead simple - even fun - to refactor your views