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
pub enum Direction { | |
Left, | |
Right, | |
Up, | |
Down, | |
UpperLeft, | |
UpperRight, | |
DownLeft, | |
DownRight, | |
} |
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 ast | |
import base64 | |
import itertools | |
import os | |
import signal | |
import struct | |
import tempfile | |
import threading | |
import time | |
import traceback |
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 typing import TypeVar, Generic, Union, Optional | |
from dataclasses import dataclass | |
from enum import Enum, auto | |
carrier = TypeVar('carrier') | |
item = TypeVar('item') | |
@dataclass | |
class List(Generic[item]): | |
def cata(self,a): |
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
minikube start --memory=8gb --cpus=4 --driver=docker --kubernetes-version=v1.17.17 \ | |
--extra-config=apiserver.service-account-signing-key-file=/var/lib/minikube/certs/sa.key \ | |
--extra-config=apiserver.service-account-key-file=/var/lib/minikube/certs/sa.pub \ | |
--extra-config=apiserver.service-account-issuer=kubernetes.default.svc.cluster.local \ | |
--extra-config=apiserver.service-account-api-audiences=api,spire-server,nats \ | |
--extra-config=apiserver.authorization-mode=Node,RBAC \ | |
--extra-config=kubelet.authentication-token-webhook=true |
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
#![cfg(feature = "native")] // required for data i/o | |
extern crate coaster_blas as co_blas; | |
extern crate coaster as co; | |
use std::fmt; | |
use crate::co::backend::{Backend, IBackend}; | |
use crate::co::framework::{IFramework}; | |
use crate::co::plugin::numeric_helpers::{cast, Float, NumCast}; |
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
pub fn map_column<'a, ColumnType: 'static, A: 'static, B: 'static>( | |
column_data: &'a ColumnInformation<ColumnType>, | |
column_idx: usize, | |
indexes: &[usize], | |
map_fn: A, | |
) -> Box<dyn Iterator<Item = B> + 'a> | |
where | |
A: Fn(ColumnType) -> B, | |
ColumnType: std::clone::Clone, | |
{ |
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
# Path to your oh-my-zsh installation. | |
export ZSH="~/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes | |
ZSH_THEME="agnoster" | |
plugins=(git osx history) |
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
# Aliases | |
alias ls='exa -la --git --header' | |
alias cat='bat' | |
alias java_ls='/usr/libexec/java_home -Vq 2>&1 | grep -E "\d\.\d\.\d(_\d+)?.*," | cut -d , -f 1 | cut -c 5-' | |
# Changing Prompt for Bash | |
inside_git_repo="\$(git rev-parse --is-inside-work-tree 2>/dev/null)" | |
#Exports for Ruby Installation | |
export CC=clang |
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
let reducable a b = | |
{code for aA reducing to nothing etc} | |
let rec solve a x = | |
if a.length = 0 | |
then match x with | |
# a :: b indicates that x is being split into a - the head and b - the tail of the list. | |
# [] indicates an empty element | |
elem :: list_of_elems -> (solve elem list_of_elems) |
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
// Design copied from emk's Rust Streaming (github.com/emk/rust-streaming) | |
use std::cell::Cell; | |
pub struct StreamingView<'a, T> { | |
cur: Cell<usize>, | |
limit: usize, | |
reference: &'a[T] | |
} | |
#[macro_export] |
NewerOlder