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
trait Functor { | |
type A; | |
type F<B>; | |
fn fmap<B>(self, f: impl Fn(Self::A) -> B) -> Self::F<B>; | |
} | |
impl<T> Functor for Option<T> { | |
type A = T; | |
type F<B> = Option<B>; |
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
#!/usr/bin/env ts-node | |
const path = require('path') | |
const fs = require('fs') | |
if (!process.argv[2]) { | |
process.stderr.write(`Usage: ${process.argv[1]} <filename>\n`) | |
return -1 | |
} | |
const filePath = path.join(process.cwd(), process.argv[2]) |
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
#!/usr/bin/env python | |
import tempfile | |
import sys | |
import subprocess | |
import os | |
import errno | |
# Make temp. file for input | |
inp = tempfile.NamedTemporaryFile(suffix='.mdk',mode='wb',dir=os.getcwd()) |
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
#!/usr/bin/env -S deno run --allow-net=api.nasa.gov,apod.nasa.gov --allow-env --allow-write=${HOME}/.apodwallpaper --allow-run | |
// Filename: apod.ts | |
// Purposes: Downloads NASA Astronomy Picture of the Day and displays it as the background using feh | |
// Author(s): Nikolay "Lierdakil" Yakimov https://github.com/lierdakil | |
// !!! Replace this with your NASA API key; go to https://api.nasa.gov/ to get one | |
const api_key = 'DEMO_KEY' | |
// Read home variable |
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 <array> | |
#include <boost/dynamic_bitset/dynamic_bitset.hpp> | |
#include <future> | |
#include <iomanip> | |
#include <iostream> | |
#include <stdexcept> | |
#include <utility> | |
#include <vector> | |
enum class St { Empty, Occupied }; |
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
clang | |
-I/usr/include/libusb-1.0 |
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
node_modules |
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
struct bar { int foo; }; | |
const struct bar fizz = { 10 }; | |
void baz(struct bar * a) { | |
a->foo = 30; | |
} | |
int main() { | |
//fizz.foo = 20; // does not compile |
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
all: | |
clang++ -std=c++17 keypoll.cpp -o keypoll -lstdc++fs -lpthread |
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
// Note: uses C++17 fs features; build with | |
// g++ -std=c++17 event-reader.cpp -lstdc++fs | |
// | |
// Licensed under the following terms: | |
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
// Version 2, December 2004 | |
// | |
// Copyright (C) 2004 Sam Hocevar <[email protected]> | |
// | |
// Everyone is permitted to copy and distribute verbatim or modified |
NewerOlder