Skip to content

Instantly share code, notes, and snippets.

View MasseGuillaume's full-sized avatar

Guillaume Massé (马赛卫) MasseGuillaume

  • narrative.io
  • Montréal, Québec, Canada
  • 14:07 (UTC -04:00)
View GitHub Profile
@martijnvermaat
martijnvermaat / nixos.md
Last active March 24, 2024 11:42
Installation of NixOS with encrypted root

Moldbug Should Be Sanctioned

I want to start off by saying that I strongly respect John De Goes and the decision he made. If you haven't already read his extensive post about what he did and why he did it, I highly recommend you take the time. His post is thorough and generally persuaded me to his way of thinking, which is not that the works of Moldbug should be accepted or ignored, but that we need to be inclusive of differing beliefs in a community, so long as the holder of those beliefs is willing to "leave them at the door". This is a strong, intellectually defensible and consistent position.

However, as the day has gone on, and I've discussed this issue at length with many members of the community. I have come to the conclusion that this is idealistic, and ultimately missing the point. And as strange as it seems, the point is not that there is a literal Neo Nazi who will be speaking at a well-regarded conference! The point is somehow bigger tha

@spaceCamel
spaceCamel / NOTES.md
Last active March 20, 2020 17:20
PulseAudio + Bluetooth Headset

After updating the configuration

nixos-rebuild switch

I had to restart the system for pulseaudio to load the bluetooth module.

pactl list should show the bluetooth module.

As I'm not using a desktop-manager I've configured the device from the command line following ArchLinux instructions

@paulp
paulp / universal.scala
Created May 6, 2015 16:21
existentials are inverted universals
// [info] Running p.Run
// List(Fish(Bob, Esq.,12), Kitty(Thor, Esq.,java.awt.Color[r=255,g=200,b=0]))
import java.awt.Color
package p {
trait Pet[A] {
def name(a: A): String
def renamed(a: A, newName: String): A
}
@retronym
retronym / log.scala
Last active August 29, 2015 14:15
Enumerating all members of a Scala package with compiler internal APIs
scala>
scala>
scala> {
| def explode(p: Symbol): Stream[Symbol] = {
| val members =
| if (p.isClass) p.info.decls.toStream.filterNot(sym => sym.isJava || sym.isImplClass).flatMap(explode)
| else if (p.isPackage || p.isModule) explode(p.moduleClass)
| else Stream()
@MasseGuillaume
MasseGuillaume / sol.scala
Last active August 29, 2015 14:05
Twitter OSCON coding puzzle
import scala.util.Try
val nl = System.lineSeparator
def gliff(xs: String) = {
xs.stripMargin.split(nl).to[List]
}
val gliffs =
Map(
@devinceble
devinceble / atom-application.js
Last active August 29, 2015 14:04
atom-application.js
(function() {
var ApplicationMenu, AtomApplication, AtomProtocolHandler, AtomWindow, AutoUpdateManager, BrowserWindow, EventEmitter, Menu, app, dialog, fs, ipc, net, os, path, shell, socketPath, url, _,
__slice = [].slice;
AtomWindow = require('./atom-window');
//ApplicationMenu = require('./application-menu');
AtomProtocolHandler = require('./atom-protocol-handler');
@runarorama
runarorama / gist:a8fab38e473fafa0921d
Last active April 13, 2021 22:28
Compositional application architecture with reasonably priced monads
sealed trait Interact[A]
case class Ask(prompt: String)
extends Interact[String]
case class Tell(msg: String)
extends Interact[Unit]
trait Monad[M[_]] {
def pure[A](a: A): M[A]
@johnjohndoe
johnjohndoe / vimeo.com.ffpreset
Created December 15, 2011 01:18
FFmpeg settings for vimeo.com
// FFmpeg settings for vimeo.com
// =============================
// Trying to find the best settings for encoding videos as described here: http://vimeo.com/help/compression
//
// Input file: MTS
// Video: H264, 1920x1080, 50fps
// Audio: A52 Audio (aka AC3), Stereo, 48kHz, 256kbps
ffmpeg -i input.mts -vcodec libx264 -acodec aac -strict experimental -vpre hq -s hd720 -b 5000k -ab 320k -r 25 -g 25 -threads 0 output.mp4
@chezou
chezou / re2testbasic.cpp
Created November 26, 2011 12:05
Sample code of re2 basic regexp functions.
#include <iostream>
#include <string>
#include <re2/re2.h>
#include <vector>
using namespace std;
void test_fullmatch(){
string s,t;
string str("あぶらかたぶら");