Skip to content

Instantly share code, notes, and snippets.

View Wonderfall's full-sized avatar
:electron:
Always learning stuff

Wonderfall Wonderfall

:electron:
Always learning stuff
View GitHub Profile
@Wonderfall
Wonderfall / main.rs
Created May 8, 2021 02:11
Rust median, mean and mode
use std::collections::HashMap;
fn main () {
let mut numbers = vec![12, 14, 8, 3, 5, 19, 23, 24, 28, 32, 48, 13, 13, 48];
println!("median is {}", median(&mut numbers));
println!("mean is {}", mean(&numbers));
println!("mode is {}", mode(&numbers));
}
@Wonderfall
Wonderfall / nginx-http2-hpack.patch
Created September 20, 2017 17:07
Nginx HPACK patch
diff --git a/auto/modules b/auto/modules
index be3561e6..1be97dd1 100644
--- a/auto/modules
+++ b/auto/modules
@@ -436,6 +436,10 @@ if [ $HTTP = YES ]; then
. auto/module
fi
+ if [ $HTTP_V2_HPACK_ENC = YES ]; then
+ have=NGX_HTTP_V2_HPACK_ENC . auto/have

Keybase proof

I hereby claim:

  • I am wonderfall on github.
  • I am wonderfall (https://keybase.io/wonderfall) on keybase.
  • I have a public key ASC6O64BtN0ujLouh_GQcoWcubfodE6wZ4YYuM1vf32TxQo

To claim this, I am signing this object:

puts "Un simple pendu. On se passera de règles..."
points = 0
loop do
print "Saisissez un mot : "
motMystere = gets.chomp
cache = motMystere.gsub(/./, '_')
30.times { puts }
puts "Un simple pendu. On se passera de règles..."
points = 0
loop do
print "Saisissez un mot : "
motMystere = gets.chomp
cache = String.new
motMystere.length.times { cache += "_" }
30.times { puts }
@Wonderfall
Wonderfall / shakewords.rb
Last active August 29, 2015 14:02
Shake some words!
# Copyleft
# Thanks to Caletlog ! Shorter & Faster !
# Good game !
puts "You have to find a secret word, each player has 5 tries !"
score = 0
loop do
print "Enter some word : "
secretWord = gets.chomp
30.times { puts }