Skip to content

Instantly share code, notes, and snippets.

Avatar
🐍

Nicolas Dubois wo0dyn

🐍
View GitHub Profile
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 Feb 19, 2021 — 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 Oct 17, 2016 — 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 Dec 4, 2015
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 Jul 26, 2014
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 Jan 20, 2014 — 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
@wo0dyn
wo0dyn / css_resources.md
Created Jan 20, 2014 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.
View css_resources.md

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides