Skip to content

Instantly share code, notes, and snippets.

@misho104
misho104 / extend.sh
Created June 30, 2023 00:48
余白作成 #imagemagick #pdf
identify $i | sed 's/.*JPEG //' | sed 's/ .*//' | sed 's/x/ /' | read a b
echo $((2489-$a)) | read c
echo $i $c
convert a4.png $i -geometry +$c+0 -composite $i.ext.jpg

Keybase proof

I hereby claim:

  • I am misho104 on github.
  • I am misho104 (https://keybase.io/misho104) on keybase.
  • I have a public key whose fingerprint is 431B 6AC0 7E38 FBF5 12E5 777A 04D8 B889 EA69 E60F

To claim this, I am signing this object:

openpgp4fpr:431B6AC07E38FBF512E5777A04D8B889EA69E60F

@misho104
misho104 / around3digit.m
Created July 12, 2021 13:51
Show 3 digits of Around[]
Around[0,0]; Language`UncertaintyDump`$UDT = 1000;
@misho104
misho104 / template.wl
Last active July 3, 2021 17:00
#template for Mathematica
(* Time-Stamp: <> *)
(* Copyright 2021 Sho Iwamoto / Misho
This file is licensed under the Apache License, Version 2.0.
You may not use this file except in compliance with it. *)
(* Copyright 2021 Sho Iwamoto / Misho
This file is still private and not yet under any license.
Without explicit permission, you may not copy, modify,
or distribute it, or create a derived work based on it. *)
@misho104
misho104 / ExpandableDot.wl
Created June 10, 2020 23:59
Expandable Dot
Unprotect[Dot];
Dot[x1___, Times[a_, b__], x2___] := Dot[x1, a, Times[b], x2]
Dot[x1___, Plus[a_, b__], x2___] :=
Dot[x1, a, x2] + Dot[x1, Plus[b], x2]
Dot[x1___, a : (_Real | _Complex | _Integer | _Rational), x2___] :=
a Dot[x1, x2]
Protect[Dot];
@misho104
misho104 / mathematica.py
Created May 15, 2020 14:20
Mathematica-call from python
#!env python3
import pathlib
import wolframclient.evaluation
if __name__ == "__main__":
this_file_dir = pathlib.Path(__file__).absolute().parent
session = wolframclient.evaluation.WolframLanguageSession()
for cmd in [
@misho104
misho104 / init.m
Last active March 5, 2020 16:53
Mathematica hack to apply timestamp comment
SetOptions[$FrontEnd,
NotebookEventActions :> {
{"MenuCommand", "Save"} :>
Module[{
datetime = Map[
TextString[(LinkWrite[First[$FrontEnd], FrontEnd`Value[#]]; LinkRead[First[$FrontEnd]])] &,
{"Year", "Month", "Day", "Hour", "Minute", "Second"}
] // Riffle[#, {"-", "-", " ", ":", ":"}] & // StringJoin,
pos = (
SelectionMove[EvaluationNotebook[], After, Notebook, AutoScroll -> False];
@misho104
misho104 / gist:46032fa730088a0cb4c2e0556c59260b
Last active February 17, 2019 17:37 — forked from ev-br/gist:9081651
akima / pchip
from scipy.interpolate import Akima1DInterpolator as Akima
from scipy.interpolate import PchipInterpolator as pchip
from scipy.interpolate import CubicSpline as cubic
import numpy as np
import matplotlib.pyplot as plt
plt.ion()
np.random.seed()
def show_plot(x, y):
@misho104
misho104 / mathematica_remove_mesh.m
Created December 2, 2018 20:36
Mathematica Plot without Mesh
Map[SetOptions[#,
Prolog -> {{EdgeForm[], Texture[{{{0, 0, 0, 0}}}],
Polygon[#, VertexTextureCoordinates -> #] &[{{0, 0}, {1,
0}, {1, 1}}]}}] &, {Graphics3D, ContourPlot3D,
ListContourPlot3D, ListPlot3D, Plot3D, ListSurfacePlot3D,
ListVectorPlot3D, ParametricPlot3D, RegionPlot3D, RevolutionPlot3D,
SphericalPlot3D, VectorPlot3D, RegionPlot, ContourPlot}];