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] | |
name = "mymastermind" | |
version = "0.1.0" | |
authors = ["Yvan Sraka <[email protected]>"] | |
edition = "2018" | |
[dependencies] | |
ansi_term = "0.11.0" | |
rand = "0.5.0" |
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 | |
# SPDX-License-Identifier: 0BSD or CC0-1.0 or MIT-0 or Unlicense | |
# Copyright (c) 2023, Ryan Castellucci, No Rights Reserved | |
import io, sys | |
import datetime | |
import argparse | |
import requests | |
import operator | |
import struct |
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
#![feature(try_trait_v2)] | |
use std::ops::Try; | |
trait Monoid: Default { | |
fn mappend(self, rhs: Self) -> Self; | |
} | |
impl Monoid for i32 { | |
fn mappend(self, rhs: Self) -> Self { | |
self + rhs |
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
fn main() { | |
let x = vec![1, 2, 3]; | |
for i in 0..=x.len() { | |
println!("{}", x[i]); | |
} | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
typedef enum { | |
MOV, | |
SET, | |
ADD, | |
SUB, | |
JMP, | |
SYSCALL, |
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 functools | |
def memoization(f): | |
cache = {} | |
def func_wrapper(n): | |
if n not in cache: | |
result = f(n) | |
cache[n] = result | |
return cache[n] | |
return func_wrapper |
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
fn main() { | |
let mut input = String::new(); | |
std::io::stdin().read_line(&mut input).unwrap(); | |
println!("Input: {}", input); | |
let result = input | |
.trim() | |
.chars() | |
.filter(|&ch| ch != '=') | |
.map(|ch| { | |
let ascii = ch as i8; |
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 bash | |
old_path="$1" | |
new_path="../fixed/$(echo "$old_path" | iconv -f utf-8 -t ascii//translit)" | |
if [[ -d $old_path ]]; then | |
mkdir -p "$new_path" | |
elif [[ -f $old_path ]]; then | |
rsync -azP "$old_path" "$new_path" | |
fi |
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
# angles.py - http://www.graphviz.org/Gallery/gradient/angles.html | |
from graphviz import Digraph | |
g = Digraph('G', filename='angles.gv') | |
g.attr(bgcolor='blue') | |
with g.subgraph(name='cluster_1') as c: | |
c.attr(fontcolor='white') | |
c.attr('node', shape='circle', style='filled', fillcolor='white:black', |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
TODO: C0111: Missing module docstring (missing-docstring) | |
""" | |
import os | |
from json import load |
NewerOlder