Skip to content

Instantly share code, notes, and snippets.

View 71's full-sized avatar

Grégoire Geis 71

View GitHub Profile
@71
71 / Eff.go
Created February 7, 2020 23:08
Trying to implement algebraic effects in Go.
// Inspired by https://github.com/ocamllabs/ocaml-effects-tutorial
//
// Goroutines can be implemented using effects, and, as it turns
// out, effects can be implemented using Goroutines.
// It does require an explicit `context.Context` argument, though.
//
// Note: The following code is a quick and dirty experiment. It
// is not efficient, and probably leaks memory.
package main
@71
71 / notebook.ipynb
Last active August 23, 2023 17:08
Crawling Melon and analyzing Korean song lyrics for a group assignment.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@71
71 / nocc.js
Created March 22, 2019 07:59
Violent Monkey script that removes closed captions from subtitles on Netflix.
// ==UserScript==
// @name No closed captions
// @namespace Violentmonkey Scripts
// @match https://www.netflix.com/watch/*
// @grant none
// ==/UserScript==
let lastContainer = null
function removeClosedCaptions() {
@71
71 / nx.sh
Created November 28, 2018 17:00
Run a command in a Nix-aware PRoot environment.
#!/bin/bash
# Run the given command in a Nix-aware environment installed in
# '~/opt/nix', assuming PRoot is available in '~/opt/bin/proot-x86_64'.
#
# If no arguments are given, 'zsh' is executed.
#
# Note:
# The full path to 'nix.sh' is given instead of '~/.nix-profile/etc/profile.d/nix.sh',
# because in some cases, the symlink may not be property set up when running the script.
@71
71 / SpecialChars.ahk
Last active November 16, 2021 22:26
My personal keyboard layout, named after its WASD replacement YATH.
; AutoHotKey script that sends the right symbols to Windows.
; Useful, since I can reprogram most of my keys on my keyboard, but not special characters.
#NoEnv
SendMode Input
$1::Send {1}
$2::Send {2}
$3::Send {3}
$4::Send {4}
@71
71 / Make-Submission.ps1
Last active November 17, 2017 15:24
Make an EPITA submission using PowerShell.
<#
.SYNOPSIS
Creates a .zip file matching the submission format required by EPITA.
.EXAMPLE
Make-Submission -Author gregoire.geis -Nth 0 -Items ./TP0 -Exclude bin,obj -ReadMe "First submission!"
Make-Submission -Author gregoire.geis -Nth 0 -Items tp0.ml
#>
function Make-Submission (
[Parameter(Mandatory=$true)] [string] $Author,
@71
71 / Profile.ps1
Last active December 15, 2019 21:04
A file that reminds me of every step to do when setting up a new Windows machine.
# Load all init scripts
Get-ChildItem $Home\OneDrive\Code\PowerShellInit\* -Include *.ps1 -Recurse | % { . $_ }
@71
71 / Get-NgrokStatus.ps1
Created August 26, 2017 20:51
PowerShell module used to easily get the status of an Ngrok user.
<#
.SYNOPSIS
Gets the status of an Ngrok user.
.EXAMPLE
Get-NgrokStatus -Credential (Get-Credential)
#>
function Get-NgrokStatus([Parameter(Mandatory=$true)] [PSCredential] $Credential) {
# Find CSRF Token
$Req = Invoke-WebRequest 'https://dashboard.ngrok.com/user/login' -UseBasicParsing -SessionVariable Session
@71
71 / FbWatch.js
Last active April 8, 2017 12:21
Simple script that tells me "You've been on Facebook n minutes now, c'mon." when I spend too much time on Facebook.
// ==UserScript==
// @name Facebook watcher
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Makes sure you don't spend too much time on Facebook
// @author You
// @require http://coffeescript.org/v1/browser-compiler/coffee-script.js
// @match https://www.facebook.com/*
// ==/UserScript==
@71
71 / ExampleAsync.cs
Last active January 25, 2023 20:34
A file I used to understand how async / await works behind-the-scenes in C#.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace Tests
{
/// <summary>