Skip to content

Instantly share code, notes, and snippets.

View julienXX's full-sized avatar

Julien Blanchard julienXX

View GitHub Profile
@staltz
staltz / introrx.md
Last active May 6, 2024 01:44
The introduction to Reactive Programming you've been missing
@munificent
munificent / generate.c
Last active May 1, 2024 20:06
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');
@sent-hil
sent-hil / pictures.markdown
Created August 24, 2012 02:18
River (getriver.com): Keep a programming journal.

One of my favorite past times is to look at the notebooks of famous scientists. Da Vinci's notebook is well known, but there plenty others. Worshipping Da Vinci like no other, I bought a Think/Create/Record journal, used it mostly to keep jot down random thoughts and take notes. This was great in the beginning, but the conformity of lines drove me nuts. Only moleskines made blank notebooks, so I had to buy one.

At the same time I started a freelance project. The project itself is irrelevant, but suffice to say it was very complex and spanned several months. It seemed like a perfect opportunity to use the moleskine. Looking back, all my entries fell under few categories:

  • Todo
  • Question
  • Thought
  • Bug
  • Feature
@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 ".*" ".*" ".*"
@lenary
lenary / gitconfig.ini
Created February 18, 2011 01:21
a special excerpt of my gitconfig
$ git clone github:lenary/guides.git
Cloning into guides...
remote: Counting objects: 255, done.
remote: Compressing objects: 100% (216/216), done.
remote: Total 255 (delta 111), reused 163 (delta 35)
Receiving objects: 100% (255/255), 1.49 MiB | 564 KiB/s, done.
Resolving deltas: 100% (111/111), done.
$ cd guides
$ git remote -v

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.

@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 =
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@asmuth
asmuth / mongoid_prefixable.rb
Created November 6, 2011 22:32
Dynamic (prefixed at runtime) collection names for mongoid models
# uber-hacky dynamic collection names for MongoID models:
#
# class MyModel
# include Mongoid::PrefixableDocument # ...instead of Mongoid::Document
# include Mongoid::Timestamps
#
# field :foobar, :type => Integer
#
# def my_method; 123; end
#