Skip to content

Instantly share code, notes, and snippets.

@takuma7
takuma7 / Wizard.tsx
Created August 24, 2020 04:12
react-final-form Wizard TypeScript (enhanced)
View Wizard.tsx
import React from 'react'
import { Form, FormRenderProps } from 'react-final-form'
interface Props<Values> {
initialValues?: Partial<Values>
onSubmit: (values: Values) => Promise<void>
pages: React.ReactElement<WizardPageProps<Values>>[]
children: (
props: FormRenderProps<Values> & {
View horizontal-images-same-height.tex
%%%% Preamble >>>
\usepackage{subcaption}
\newlength{\twosubht}
\newsavebox{\twosubbox}
%%%%% <<<
\begin{figure}[htp]
% preliminary
\sbox\twosubbox{%
\resizebox{\dimexpr.99\textwidth-1em}{!}{% {(num of image)-1}em
View wu.nb
(* Sort list of polynomial functions (fs) based on degree of x in ascending order *)
SortByDegree[fs_, x_] := Module[{},
Comp[f1_,f2_] := Exponent[f1,x] < Exponent[f2,x];
Sort[fs,Comp]
];
(* Calculate pseud-remainder *)
Rem[f_, g_, x_] := Module[{q,r,u},
{q,r} = Together[#]&/@PolynomialQuotientRemainder[f,g,x];
u = PolynomialLCM[Denominator[q], Denominator[r]];
@takuma7
takuma7 / opencv-fourcc-on-mac-os-x.md
Last active August 23, 2023 13:55
OpenCV Video Writer on Mac OS X
View opencv-fourcc-on-mac-os-x.md
@takuma7
takuma7 / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@takuma7
takuma7 / gist:9616189
Last active October 1, 2018 01:09 — forked from jimbojsb/gist:1630790
Keynoteにシンタックスハイライトされたソースコードをはりつける方法
View gist:9616189

Step 0:

MacにHomebrewが入っていない場合はインストールする

Step 1:

highlightをインストールする

brew install highlight
View a3.py
# coding: utf8
import a2
import csv
reader = csv.DictReader(open("evaluation-values.csv"))
leapAvg = 0
leapNum = 0
nonLeapAvg = 0
View a2.py
# coding: utf8
def isLeapYear(x):
return x%4 == 0 and x%100 != 0 or x%400 == 0