Skip to content

Instantly share code, notes, and snippets.

View Gmousse's full-sized avatar
🏠
Working from home

Guillaume Mousnier Gmousse

🏠
Working from home
View GitHub Profile
@Gmousse
Gmousse / randomPickRestaurantOnDeliveroo.js
Created September 20, 2018 08:50
Pick a random restaurant on the Deliveroo current page
/**
* Open a random restaurant page from the current deliveroo page.
*/
function pickARestaurant() {
const restaurants = Array.from(document.getElementsByTagName('a')).filter(x => x.children[0] && x.children[0].className.includes("RestaurantCard")).map(x => x.href);
window.open(restaurants[Math.round(Math.random() * restaurants.length)]);
}
@Gmousse
Gmousse / downloadBundle.js
Created August 30, 2018 17:09
Download all humble bundle links
/**
* Download all Humble bundle items of a specific type (eg: EPUB).
* @param {String} innerText The tag of the items to download.
*/
function downloadAllBundleItems(innerText) {
return Array.from(document.getElementsByTagName('a')).filter(x => x.innerText == innerText).forEach(x => window.open(x.href));
}
@Gmousse
Gmousse / .zshrc
Last active July 16, 2024 13:50
A synced .zshrc used to give default config to my environment.
# Copyright (c) 2018 Guillaume Mousnier
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
@Gmousse
Gmousse / install-code.sh
Last active July 16, 2024 11:27
My script to install my Manjaro laptop
#! /bin/bash
# Copyright (c) 2018 Guillaume Mousnier
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
@Gmousse
Gmousse / README.md
Last active June 9, 2019 14:09
Simple JS functions benchmark

Simple Benchmark

A simple benchmark library to benchmark js functions without installing 1go of depedencies.

Requirements

Nodejs: 6.x.x, 7.x.x, 8.x.x, 9.x.x

Installation

@Gmousse
Gmousse / d3-tree-compute.js
Created April 18, 2017 13:49
D3.js natural tree generator
/*
The MIT License (MIT)
Copyright (c) 2017 Guillaume Mousnier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@Gmousse
Gmousse / percolate.js
Last active February 16, 2017 22:17
percolate, a function to filter callbacks by delay
/*
The MIT License (MIT)
Copyright (c) 2016 Guillaume Mousnier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@Gmousse
Gmousse / album.jsx
Last active April 18, 2017 13:34
Mobx Application Example
/*
The MIT License (MIT)
Copyright (c) 2016 Guillaume Mousnier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@Gmousse
Gmousse / pascalTriangle.hs
Last active April 18, 2017 18:14
Pascal Triangle with functional programming. A kind of "hello world".
#!/usr/bin/env runhaskell
--
-- The MIT License (MIT)
--
-- Copyright (c) 2016 Guillaume Mousnier
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello React + D3!</title>
<!-- React -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.0/react.min.js" type="text/javascript" ></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.0/react-dom.min.js" type="text/javascript" ></script>
<script src="http://npmcdn.com/[email protected]/browser.min.js"></script>