Skip to content

Instantly share code, notes, and snippets.

View cloderic's full-sized avatar

Clodéric Mars cloderic

View GitHub Profile
@cloderic
cloderic / naive_prime_factors_decomposition.py
Created December 12, 2018 15:38
Naive Prime Factors Decomposition
# Returns true if n is a prime number
def check_prime(n):
x = 2
while(x < n):
if n % x == 0:
# Factor other then 1 or n, number is composite
return False
x = x +1
# Number is prime, while loop terminated without finding factor
return True
@cloderic
cloderic / got_families.csv
Created August 29, 2019 11:37
GOT families
parent_name parent_sex child_name child_sex
Rickard Stark M Eddard Stark M
Rickard Stark M Brandon Stark M
Rickard Stark M Benjen Stark M
Eddard Stark M Jon Snow M
Eddard Stark M Robb Stark M
Eddard Stark M Sansa Stark F
Eddard Stark M Arya Stark F
Eddard Stark M Bran Stark M
Eddard Stark M Rickon Stark M
@cloderic
cloderic / markdown.js
Created March 20, 2020 09:47
Markdown React Component
import Link from './link';
import markdown from 'remark-parse';
import React from 'react';
import rehype2react from 'rehype-react';
import remark2rehype from 'remark-rehype';
import unified from 'unified';
// Let's create a markdown compiler using unified
// -- cf. https://github.com/unifiedjs/unified
const processor = unified()