This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/sha256" | |
"encoding/hex" | |
"fmt" | |
"strings" | |
) | |
const msg = "The SHA256 for this sentence begins with: " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest.mock import create_autospec, call | |
######################################## | |
# Only one class with private methodes # | |
######################################## | |
class Everything: | |
def do_something(self, x: int) -> int: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest.mock import create_autospec, call | |
######################################## | |
# Only one class with private methodes # | |
######################################## | |
class Everything: | |
def do_something(self, x: int) -> int: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
def plot(points, label): | |
dates = [p[0] for p in points] | |
y = 100 | |
values = [] | |
for _, augment in points: | |
y *= 1 + augment / 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import logging | |
import requests | |
logging.basicConfig(level=logging.INFO) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def primal(n): | |
factors = [] | |
d = 2 | |
while n > 1: | |
while n % d == 0: | |
factors.append(d) | |
n = n / d | |
d += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function printDotted() { | |
echo -n $@ | |
for i in $(seq $[$RANDOM % 10]); do | |
echo -n '.' | |
sleep 0.1 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# | |
# Purpose: | |
# Extend the date parsing capabilities of Ruby to work with dates with international month names. | |
# | |
# Usage: | |
# | |
# Date.parse_international(date_string) | |
# DateTime.parse_international(date_string) | |
# date_string.to_international_date |