Skip to content

Instantly share code, notes, and snippets.

@mkakh
mkakh / nat.rs
Last active September 8, 2019 11:29
練習用の駄作
use std::convert::From;
use std::cmp::Ordering;
use std::fmt;
use std::rc::Rc;
use Nat::*;
#[derive(Clone, PartialEq)]
enum Nat {
Succ(Rc<Nat>),
Zero,
# datasetを読み込む
from keras.datasets import cifar100
(x_train, y_train), (x_test, y_test) = cifar100.load_data()
# 入力のリサイズ (InceptionV3の仕様のため)
import cv2
import numpy as np
from keras.utils import np_utils
#image_size = 299
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.3.4 Kernel Configuration
#
#
# Compiler: gcc (GCC) 9.2.0
#
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=90200
#!/bin/sh
for i in .ssh/*; do
echo "=== $i ==="
cat $i
echo
done
SRCDIR = src
OBJDIR = obj
BINDIR = bin
PROGS = test hoge fuga
.PHONY: all clean
all: $(addprefix $(BINDIR)/,$(PROGS))
$(BINDIR)/test: $(OBJDIR)/test.o
$(BINDIR)/hoge: $(OBJDIR)/hoge.o
#!/bin/sh
DPTDIR="$HOME/dptrp1"
TARGETDIR="$DPTDIR/M1/Papers"
for i in ~/DocSync/*.pdf; do
if [ -z "`find $DPTDIR -name \"${i##*/}\"`" ]; then
cp -v "$i" $TARGETDIR
fi
done
@mkakh
mkakh / init.vim
Last active December 15, 2022 00:31
set nocompatible
"" UTF-8
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8
"" SYNTAX
syntax enable
filetype indent on
@mkakh
mkakh / MyDict.py
Last active June 8, 2023 10:44
created by BingAI
#!/usr/bin/env python3
import os
from PyDictionary import PyDictionary
from gruut import sentences
dictionary = PyDictionary()
def get_meaning(word):
# check if dict.txt exists
if not os.path.exists('dict.txt'):
open('dict.txt', 'w').close()
@mkakh
mkakh / Merriam-Webster API from CLI.py
Last active June 13, 2023 02:12
generated by Bing AI
#!/usr/bin/env python3
import requests
import json
import re
api_key = "YOUR_API_KEY"
def clean_text(text):
text = re.sub(r'{[a-z]+}', '', text)
text = re.sub(r'{/[a-z]+}', '', text)
@mkakh
mkakh / starship-for-warp.toml
Created June 28, 2023 01:14
a setting file of starship for warp terminal (I just changed the format variable from the default setting to disable '>')
# Warning: This config does not include keys that have an unset value
# $all is shorthand for $username$hostname$localip$shlvl$singularity$kubernetes$directory$vcsh$fossil_branch$git_branch$git_commit$git_state$git_metrics$git_status$hg_branch$pijul_channel$docker_context$package$bun$c$cmake$cobol$daml$dart$deno$dotnet$elixir$elm$erlang$fennel$golang$gradle$haskell$haxe$helm$java$julia$kotlin$lua$nim$nodejs$ocaml$opa$perl$php$pulumi$purescript$python$raku$rlang$red$ruby$rust$scala$solidity$swift$terraform$vlang$vagrant$zig$buf$guix_shell$nix_shell$conda$meson$spack$memory_usage$aws$gcloud$openstack$azure$env_var$crystal$custom$sudo$cmd_duration$line_break$jobs$battery$time$status$container$os$shell$character
"$schema" = "https://starship.rs/config-schema.json"
# format = "$all"
format="$username$hostname$localip$shlvl$singularity$kubernetes$directory$vcsh$fossil_branch$git_branch$git_commit$git_state$git_metrics$git_status$hg_branch$pijul_channel$docker_context$package$bun$c$cmake$cobol$daml$dart$deno$dotnet