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)
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> & {
%%%% Preamble >>>
\usepackage{subcaption}
\newlength{\twosubht}
\newsavebox{\twosubbox}
%%%%% <<<
\begin{figure}[htp]
% preliminary
\sbox\twosubbox{%
\resizebox{\dimexpr.99\textwidth-1em}{!}{% {(num of image)-1}em
(* 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 April 3, 2024 07:29
OpenCV Video Writer on Mac OS X
puts "Hello World"
@takuma7
takuma7 / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// 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にシンタックスハイライトされたソースコードをはりつける方法

Step 0:

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

Step 1:

highlightをインストールする

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