Skip to content

Instantly share code, notes, and snippets.

View julienXX's full-sized avatar

Julien Blanchard julienXX

View GitHub Profile
@munificent
munificent / generate.c
Last active March 18, 2024 08:31
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@brettscott
brettscott / aes-256-cbc-test.js
Last active March 25, 2024 03:44
AES 256 CBC encryption between Golang and Node JS
// Node v6.9.0
//
// TEST FILE (cut down for simplicity)
// To ensure Golang encrypted string can be decrypted in NodeJS.
//
let crypto;
try {
crypto = require('crypto');
@rgaidot
rgaidot / compose-install.service
Created January 28, 2017 13:11
Docker Compose on CoreOS
[Unit]
Description=Docker Compose on CoreOS
After=docker.service
Requires=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
TimeoutStartSec=0
@sdieunidou
sdieunidou / rabbitmq.txt
Created October 22, 2015 19:51
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@raichoo
raichoo / gist:f1ecaff3a465bbbd797b
Created July 16, 2015 21:04
Comonad: Dual of a Monad
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RebindableSyntax #-}
module Comonad where
import Prelude (Functor(..))
class Functor m => Monad m where
return :: a -> m a
join :: m (m a) -> m a
@michaelt
michaelt / weather.hs
Created May 17, 2015 16:46
weather.hs
{-# LANGUAGE OverloadedStrings #-}
module Main where
import System.Environment
import Data.Monoid
import Control.Monad
import Data.Aeson
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Network.HTTP.Client

How to put a GNU/Linux installation on your Chromebook

DISCLAIMER: This could all quite plausibly brick your Chromebook, and I take no responsibility for any damage you might inflict on it or yourself. Follow along at your own risk.

Most Chromebooks can run some flavour of GNU/Linux using the Chrubuntu method, running off the kernel that comes with ChromeOS. I found, however, that the ChromeOS kernel didn’t play well with recent X.org versions, and would refuse to recover from suspend, and not deal very well at all with having an external screen attached to it.

I also wanted to replace ChromeOS entirely with Arch on my Chromebook, because only 16 gigabytes of eMMC isn’t very convenient for dual booting. To accomplish this, I needed an external installation medium.

First of all, you’ll need to get your Chromebook into developer mode if you haven’t already. This is model specific, although for most recent models holding the Escape and Reload keys while booting should do the trick. If not, ask Google.

@danclien
danclien / Main.hs
Created February 10, 2015 18:56
Using Aeson without type classes.
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-
build-depends: base >=4.7 && <4.8
, aeson
, aeson-qq
, bytestring
, text
@vbfox
vbfox / Dapper.fs
Last active April 21, 2022 02:58
Minimal dapper in F#
module DapperFSharp =
open System.Data.SqlClient
open System.Dynamic
open System.Collections.Generic
open Dapper
let dapperQuery<'Result> (query:string) (connection:SqlConnection) =
connection.Query<'Result>(query)
let dapperParametrizedQuery<'Result> (query:string) (param:obj) (connection:SqlConnection) : 'Result seq =