Skip to content

Instantly share code, notes, and snippets.

View B1Z0N's full-sized avatar
🐢
contemplating

Mykola Fedurko B1Z0N

🐢
contemplating
View GitHub Profile
@Hirrolot
Hirrolot / CoC.ml
Last active March 5, 2024 09:47
Barebones lambda cube in OCaml
(* The syntax of our calculus. Notice that types are represented in the same way
as terms, which is the essence of CoC. *)
type term =
| Var of string
| Appl of term * term
| Binder of binder * string * term * term
| Star
| Box
and binder = Lam | Pi
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
'use strict'
const { resolve, extname } = require('path')
const http = require('http')
const fs = require('fs')
const PORT = process.env.PORT || 8080
const PUBLIC_PATH = 'public/' // place it directory, where you execute node
const MIME_TYPES = {
@branneman
branneman / curry.js
Last active August 2, 2022 05:51
Higher order auto curry function
'use strict'
const curryN = (() => {
const isPlaceholder = x => x['@@functional/placeholder'] === true
const filterPlaceholders = xs => xs.filter(x => isPlaceholder(x))
const filterValues = xs => xs.filter(x => !isPlaceholder(x))
return (arity, fn, accIn = []) => (...args) => {
const accOut = accIn.slice()
@william8th
william8th / .tmux.conf
Last active April 30, 2024 17:03
Tmux open new pane in same directory
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B)
set -g prefix C-space
unbind-key C-b
bind-key C-space send-prefix
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
@Robbepop
Robbepop / .rustfmt.toml
Created March 16, 2017 18:19
.rustfmt.toml with all configs, descriptions, parameters and defaults for version 0.7.1 of rustfmt.
# ----------------------------------------------------------------------------------
# r u s t f m t - C O N F I G
# ==================================================================================
#
# Version: 0.7.1
# Author : Robbepop <robbepop@web.de>
#
# A predefined .rustfmt.toml file with all configuration options and their
# associated description, possible values and default values for use in other
# projects.
@savely-krasovsky
savely-krasovsky / README.md
Last active February 5, 2023 14:04
Telegram webhooks with nginx reverse proxy

Make config file:

sudo nano /etc/nginx/sites-available/bot.conf

Then copy and paste bot.conf content and edit YOUR.DOMAIN strings. Now install Let's Encrypt on your server. For example in Debian you need to add jessie-backports and easily install it with apt-get:

sudo apt-get install -t jessie-backports letsencrypt

Then get cert for you domain:

@sim642
sim642 / delegate.hpp
Last active July 22, 2020 17:27
C++11 variadic template class for C# equivalent of delegates.
#ifndef DELEGATE_HPP_INCLUDED
#define DELEGATE_HPP_INCLUDED
#include <functional>
#include <vector>
// general case
template<typename R, typename... Args>
class delegate
{