Skip to content

Instantly share code, notes, and snippets.

View crosstyan's full-sized avatar

Crosstyan crosstyan

View GitHub Profile
@lagenorhynque
lagenorhynque / elixir-from-a-clojurians-perspective.md
Last active December 23, 2023 11:19
ClojurianからみたElixir

ClojurianからみたElixir


(defprofile lagénorhynque
  :id           @lagenorhynque
 :reading "/laʒenɔʁɛ̃k/"
@MattPD
MattPD / cpp.std.coroutines.draft.md
Last active April 10, 2025 13:50
C++ links: Coroutines (WIP draft)
@slightfoot
slightfoot / trim_path.dart
Created April 24, 2019 15:00
Trim Path Flutter Dart - 5th February 2019
import 'dart:ui' show Path, PathMetric, Offset;
Path trimPath(Path source, double percentage) {
/// WARNING: computeMetrics returns a iterator that can only be used ONCE!
percentage = percentage.clamp(0.0, 1.0);
if (percentage == 0.0) return Path();
if (percentage == 1.0) return Path.from(source);
final dest = Path();
@kassane
kassane / Event_Loop.md
Created April 6, 2019 14:26
Explain Event Loop

Event Loop

In computer science, the event loop, message dispatcher, message loop, message pump, or run loop is a programming construct that waits for and dispatches events or messages in a program.

It works by making a request to some internal or external "event provider" (that generally blocks the request until an event has arrived), and then it calls the relevant event handler ("dispatches the event").

The event-loop may be used in conjunction with a reactor, if the event provider follows the file interface, which can be selected or 'polled' (the Unix system call, not actual polling).

The event loop almost always operates asynchronously with the message originator.

@Adron
Adron / main.go
Created March 1, 2019 21:34
Getting min max for various types in Go
package main
import (
"fmt"
"math"
)
const(
MinUint uint = 0 // all zeroes
// Perform a bitwise NOT to change every bit from 0 to 1.
@dino-
dino- / string-conversions.hs
Last active April 13, 2025 04:38
A handy illustration of converting between String, Text and ByteString in Haskell
#! /usr/bin/env stack
-- stack --resolver lts-18.8 script
{-# LANGUAGE OverloadedStrings #-}
{-
This is a handy illustration of converting between five of the commonly-used
string types in Haskell (String, ByteString, lazy ByteString, Text and lazy
Text).
@reinzor
reinzor / stream_example.md
Last active October 29, 2024 05:42
GStreamer UDP stream examples

MJPEG

Server (Ubuntu 16.04)

gst-launch-1.0 -v filesrc location= /home/rein/Videos/big_buck_bunny_720p_30mb_0_0.mp4 ! decodebin ! videoconvert ! jpegenc ! rtpjpegpay ! udpsink host=localhost port=5000

Client (Ubuntu 16.04)

@adamelliotfields
adamelliotfields / docker-compose.yml
Created February 10, 2019 22:39
Docker Compose Mongo with Mongo Express
version: "3.5"
services:
mongo:
image: mongo:latest
container_name: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
ports:
@jprivet-dev
jprivet-dev / README.adoc
Last active April 4, 2024 06:39
[Cheatsheet] Markdown & Asciidoctor rendering in GitHub
@gtors
gtors / gist:effe8eef7dbe7052b22a009f3c7fc434
Created December 10, 2018 12:57
Makefile -> compilation_commands.json