This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "c/sys/time" | |
| lib LibC | |
| KQUEUE_CLOEXEC = O_CLOEXEC | |
| # todo: constants | |
| # EV_ADD = ... | |
| # EV_ENABLE = ... | |
| # ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lib LibC | |
| EPOLL_CLOEXEC = 0o2000000 | |
| EPOLLIN = 0x001_u32 | |
| EPOLLPRI = 0x002_u32 | |
| EPOLLOUT = 0x004_u32 | |
| EPOLLRDNORM = 0x040_u32 | |
| EPOLLRDBAND = 0x080_u32 | |
| EPOLLWRNORM = 0x100_u32 | |
| EPOLLWRBAND = 0x200_u32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "./data_layout" | |
| # I must require the WHOLE COMPILER just to load crystal/types, and then it | |
| # takes as long as compiling the compiler to compile just this file and to do | |
| # nothing. | |
| require "compiler/requires" | |
| class Crystal::ABI | |
| @nil_type : DataLayout::Aggregate? | |
| @proc_type : DataLayout::Aggregate? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Bus(A, M) | |
| include GenServer | |
| def initialize | |
| @listeners = [] of A | |
| end | |
| # public interface | |
| def subscribe(listener : A) : Nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <errno.h> | |
| #include <pthread.h> | |
| #include <signal.h> | |
| #include <stdatomic.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <ucontext.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| commit 921120d96c175d997d815805bdeced4b4fbb0cfa (HEAD -> fix/transparently-rewrite-unauthenticated-github-url-to-https) | |
| Author: Julien Portalier <julien@portalier.com> | |
| Date: Tue Apr 5 18:37:34 2022 +0200 | |
| Fix: rewrite GitHub unauthenticated URL | |
| Rewrites the URL on-the-fly and transparently from git://github.com | |
| to https://github.com because GitHub no longer supports the | |
| unauthenticated git protocol anymore. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| require "fiber" | |
| require "nio" | |
| require "timers" | |
| module Earl | |
| class Scheduler | |
| def initialize | |
| @selector = NIO::Selector.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Crée un JSON Web Token pour l'extranet, signé via HMAC SHA 256, permettant | |
| // d'identifier le CaC sur l'extranet comme utilisateur ayant accès à toutes les | |
| // données. | |
| PROCÉDURE CréerTokenExtranet() | |
| // header du token (algorithm, type) : | |
| taHeader est un tableau associatif de chaînes | |
| taHeader["alg"] = "HS256" | |
| taHeader["typ"] = "JWT" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env ruby | |
| # | |
| # A bootstrap to install locked Crystal Shards dependencies. Written in Ruby so | |
| # it doesn't need Crystal. This coul be useful to extract stdlib as distinct | |
| # shards from the main crystal-lang/crystal repository, while still allowing to | |
| # install and distribute them to build crystal, avoiding the crystal <-> shards | |
| # requirement loop. | |
| require "yaml" | |
| # helpers: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env sh | |
| ARGS=$* | |
| TASK=$1 | |
| NAME=rails-task-$(echo $TASK | sed 's/:/-/g') | |
| [ -z $TMP ] && TMP=tmp | |
| [ -z $DOCKER_IMAGE ] && DOCKER_IMAGE=eu.gcr.io/project/app:latest | |
| cleanup() { | |
| # delete the temporary yaml definition and delete the Kubernetes job: |