Skip to content

Instantly share code, notes, and snippets.

View dmanchon's full-sized avatar

Daniel Manchon dmanchon

View GitHub Profile
@klao
klao / aoc2021.apl
Last active January 20, 2023 09:36
Advent of Code 2021, Dyalog APL
⍝ https://adventofcode.com/2021
⎕IO←1 ⍝ Except where it's explicitly changed
⍝ Day 01
d←,⎕CSV'i/day01.inp'⍬2
⎕← +/2</d
⎕← +/2</3+/d
⍝ Day 02
@xpqz
xpqz / aoc21.apl
Last active March 20, 2022 04:36
AoC 21, Dyalog APL
⎕FR ⎕PP ⎕IO←1287 34 0
'iotag' 'cmat' 'foldl'⎕CY'dfns'
⍝ https://adventofcode.com/2021/day/1
1⊥2<⌿d←⍎¨⊃⎕NGET'../d/1'1⋄(¯3↓d)+.<3↓d ⍝ Note: a+b+c<b+c+d is equivalent to a<d
⍝ https://adventofcode.com/2021/day/2
d←↑' '(≠⊆⊢)¨⊃⎕NGET'../d/2'1
(fw dn up)←+/m←('forward' 'down' 'up'∘.≡⊣/d)×⍤1⍎¨⊢/d
fw×dn-up
#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@domenkozar
domenkozar / nixos-on-dell-9560.org
Last active August 25, 2023 17:07 — forked from grahamc/nixos-on-dell-9560.org
NixOS on a Dell 15" 9560 with the 4K screen.
@santi-pdp
santi-pdp / Generative Adversarial Networks toy example.ipynb
Created February 16, 2017 18:36
A toy example on Generative Adversarial Networks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@turingbirds
turingbirds / GNUPG Cheatsheet.md
Last active May 30, 2024 14:35
GPG (GNUPG) Cheatsheet

GNUPG CHEATSHEET

Setting up: key generation

This generates a public/private keypair.

$ gpg --gen-key

$ gpg --list-secret-keys

@accolver
accolver / ngLazyShow.js
Last active December 5, 2016 08:14
ng-lazy-show
'use strict';
var ngLazyShowDirective = ['$animate', function ($animate) {
return {
multiElement: true,
transclude: 'element',
priority: 600,
terminal: true,
restrict: 'A',

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!