Skip to content

Instantly share code, notes, and snippets.

Avatar
🐍

Nicolas Dubois wo0dyn

🐍
View GitHub Profile
View amber-heard.py
class Bee:
def __str__(self):
return "🐝"
class Dog:
def stepped_on(self, something):
...
if isinstance(something, Bee):
raise SystemExit("😱🥴")
View shortenize.py
def shortenize(words: str):
"""
>>> shortenize("Causses et Vallée de la Dordogne")
"Cauvaldor"
"""
View in-computer-programming.md

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?
View earth_mars.py
"""
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
View Math-Puzzle.md

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
View index.js
// 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:.*/,"")
View keybase.md

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?
View maths-puzzle.md

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”.
View exercise.md

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

acdegilmnoprstuw

such that the hash(the_string) is

910897038977002
@wo0dyn
wo0dyn / javascript_resources.md
Created January 20, 2014 15:39 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.
View javascript_resources.md

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage