This file contains 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
# src/{{app_name}}.cr | |
require "kemal" | |
require "./controllers/*" | |
alias Env = HTTP::Server::Context # this could be provided by Kemal | |
module Main | |
get "/", &->index(Env) | |
get "/:name", &->greet(Env) | |
end |
This file contains 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
import { Directive, ElementRef, Renderer } from '@angular/core'; | |
/* | |
* Adds a class to a DOM element when the mouse is over its box (:hover). | |
* This DOESN'T support adding multiple classes separated by spaces. | |
* Usage: | |
* <button class="btn" hoverClass="btn-success"> | |
*/ | |
const HoverClassDirective = class { | |
constructor(elementRef, renderer) { |
This file contains 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
/* | |
* Based on https://renenyffenegger.ch/notes/Windows/tools/swap-keys_c | |
* This code uses Windows' hooks to catch and redirect input. | |
* This code is not yet tested for DLL compilation. | |
*/ | |
#include <stdio.h> | |
#ifdef __CYGWIN__ // 2017-07-18 (tsettgchabe) | |
#define _WIN32_WINNT 0x0500 /* 0x0404 */ | |
#endif | |
#include <windows.h> |
This file contains 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
/* | |
* Conversion algorithm from LCH(ab) to RGB. Following the directives from w3. | |
* https://www.w3.org/TR/css-color-4/#lab-to-rgb | |
* | |
* Tags: luma,chroma,hue,lab,lch,cielab,c,windows,win10 | |
* Author: Carlos Gajardo (github.com/cjgajard). | |
* Date: 2020-09-04 | |
*/ | |
#define _USE_MATH_DEFINES | |
#include <math.h> |
This file contains 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 <ctype.h> | |
#include <curses.h> | |
#include <locale.h> | |
#include <string.h> | |
#include <time.h> | |
#define CTRL(c) ((c) & 0x1f) | |
#define FPS 30 | |
static int columns = 80; |