Skip to content

Instantly share code, notes, and snippets.

View wo0dyn's full-sized avatar

Nicolas C. Dubois wo0dyn

View GitHub Profile
@wo0dyn
wo0dyn / groom-this-issue.py
Last active February 15, 2024 02:40
Snippet to generate a sentence with a random weight from the Fibonacci sequence (Linear)
import random
import rich
emojis = (
":nerd_face:",
":scream:",
":smile:",
":sunglasses:",
":thinking_face:",
class Bee:
def __str__(self):
return "🐝"
class Dog:
def stepped_on(self, something):
...
if isinstance(something, Bee):
raise SystemExit("😱🥴")
def shortenize(words: str):
"""
>>> shortenize("Causses et Vallée de la Dordogne")
"Cauvaldor"
"""

In Computer Programming; 1 + 1 = …

class A(int):
    def __add__(self, value):
        return int(str(self) + str(value))
@wo0dyn
wo0dyn / earth_mars.py
Last active February 19, 2021 10:04 — forked from brunobord/earth_mars.py
What's the distance (in light-seconds and light-minutes) from Earth to Mars?
"""
Compute and display the Earth-Mars distance in light-seconds, light-minutes
and kilometers.
The easiest way is to install both ``skyfield`` & ``skyfield-data`` to compute
this:
$ pip install skyfield skyfield-data
You can also install `skyfield` only, but it'll force you to download the

Math Puzzle

One possible solution: brute force

import collections
import itertools
@wo0dyn
wo0dyn / index.js
Last active October 17, 2016 09:57 — forked from MoOx/index.js
Export GitHub labels
// go on you labels pages and paste this script in your console
var labels = [];
[].slice.call(document.querySelectorAll(".label-link"))
.forEach(function(element) {
labels.push({
name: element.textContent.trim(),
// using style.backgroundColor might returns "rgb(...)"
bgcolor: element.getAttribute("style")
.replace("background-color:", "")
.replace(/color:.*/,"")

Keybase proof

I hereby claim:

  • I am wo0dyn on github.
  • I am wo0dyn (https://keybase.io/wo0dyn) on keybase.
  • I have a public key whose fingerprint is 8801 6947 1D6E D70D 1C3C 9DE5 3F33 D53B 1F8D CF50

To claim this, I am signing this object:

@wo0dyn
wo0dyn / maths-puzzle.md
Last active December 4, 2015 08:25
Can you do the maths puzzle for Vietnamese eight-year-olds that has stumped parents and teachers?

Can you do the maths puzzle for Vietnamese eight-year-olds that has stumped parents and teachers?

Source: article from The Guardian

Script

from itertools import permutations
@wo0dyn
wo0dyn / exercise.md
Created July 26, 2014 16:42
Find a 9 letter string of characters that contains only letters from “acdegilmnoprstuw” such that the hash(the_string) is “910897038977002”.

Find a 9 letter string of characters that contains only letters from

acdegilmnoprstuw

such that the hash(the_string) is

910897038977002