Skip to content

Instantly share code, notes, and snippets.

View VictorTaelin's full-sized avatar

Victor Taelin VictorTaelin

View GitHub Profile
@takanuva
takanuva / proj.v
Created August 1, 2018 17:01
Admissibility of strong projections
(*
Prove that, due to the free theorem for impredicative sigma types, strong
projection is a valid extension. Based on Dan Doel's Agda version:
https://hub.darcs.net/dolio/agda-share/browse/ParamInduction.agda.
*)
Definition Rel (A: Prop) (B: Prop) :=
A -> B -> Prop.
Definition Sigma (T: Prop) (U: T -> Prop): Prop :=
// generator.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <experimental\generator>
#include <string>
#include <numeric>
#include <vector>
#include <cstdint>
#include <sstream>
@onlurking
onlurking / infinite.py
Last active March 6, 2018 17:44
generate all possible strings under 20 lines of Python
from itertools import count, product
from string import digits, ascii_lowercase, ascii_uppercase
from sys import stdout
import argparse
combinations = ascii_lowercase
parser = argparse.ArgumentParser()
parser.add_argument("--digits", "-d", help="include numbers", action="store_true")
parser.add_argument("--upper", "-u", help="include uppercase letters", action="store_true")
args = parser.parse_args()
@nkaretnikov
nkaretnikov / .emacs
Last active March 16, 2018 13:15
Agda .emacs
(add-to-list 'load-path "~/.emacs.d/evil")
(require 'evil)
(evil-mode 1)
;; Highlight matching parens.
(show-paren-mode 1)
;;; No tabs.
(setq-default ident-tabs-mode nil)
(setq-default tab-width 4)
@codedot
codedot / Makefile
Last active May 21, 2018 00:36
Bitcoin proof of work in pure lambda calculus
all:
node work2mlc.js getwork.json 381353fa >test.mlc
lambda -pem lib.mlc -f test.mlc
clean:
@frozeman
frozeman / mistfeatures.md
Created May 8, 2017 14:44
Mist Low Level Features
  • swarm integration
  • secure webviews
  • Mist UI
  • starting of nodes, switching networks etc
  • IPC proxy to the node
  • accounts/dapp permissions
  • preloader logic to inject stuff
  • node updatelogic
  • mist update logic
  • onboarding screen
@avafloww
avafloww / PhpJava.java
Last active April 1, 2025 18:01
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();
var os = require('os');
var util = require('util');
var Promise = require('promise');
var WebSocketClient = require('websocket').w3cwebsocket;
var macaddress = require('macaddress');
var dgram = require('dgram');
var ip = require('ip');
/**
@pascaldekloe
pascaldekloe / utf8.js
Last active September 9, 2023 05:21
JavaScript UTF-8 encoding and decoding with TypedArray
// This is free and unencumbered software released into the public domain.
// Marshals a string to an Uint8Array.
function encodeUTF8(s) {
var i = 0, bytes = new Uint8Array(s.length * 4);
for (var ci = 0; ci != s.length; ci++) {
var c = s.charCodeAt(ci);
if (c < 128) {
bytes[i++] = c;
continue;