Skip to content

Instantly share code, notes, and snippets.

@takuma7
takuma7 / opencv-fourcc-on-mac-os-x.md
Last active April 3, 2024 07:29
OpenCV Video Writer on Mac OS X
%%%% Preamble >>>
\usepackage{subcaption}
\newlength{\twosubht}
\newsavebox{\twosubbox}
%%%%% <<<
\begin{figure}[htp]
% preliminary
\sbox\twosubbox{%
\resizebox{\dimexpr.99\textwidth-1em}{!}{% {(num of image)-1}em
@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> & {
@takuma7
takuma7 / ps-grid-generator.jsx
Created November 6, 2012 06:43 — forked from jameswburke/ps-grid-generator.jsx
Photoshop Script - Generate Grid Guides
//Modified version of sprite-grid.jsx by Filip Van Tendeloo
//Fixed for earlier versions of Photoshop based on guideLine function from
//http://www.ps-scripts.com/bb/viewtopic.php?f=9&t=3493&start=0
//None of this code is mine
// check for document
if(app.documents.length > 0){
// get active document
var psDoc = app.activeDocument;
@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
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format:
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: ut-addventure_development
PImage markers = loadImage("AllBchThinMarkers.png");
int w = 12, h = 12;
int w_m = 8, h_m = 8;
int r_num = 64;
int c_num = 64;
int id = 0;
for (int ky = 0; ky < c_num * h; ky += h) {
for (int kx = 0; kx < r_num * w; kx += w) {
PImage marker = createImage(w_m, h_m, RGB);
for (int y = ky + h - h_m, _y = 0; y < ky + h; y++, _y++) {
@takuma7
takuma7 / pagination.ctp
Created August 28, 2012 02:53 — forked from slywalker/pagination.ctp
pagination element for CakePHP on twitter bootstrap
<div class="pagination">
<ul>
<?php
echo $this->Paginator->prev('«',
array(
'tag' => 'li',
'class' => 'prev',
),
$this->Paginator->link('«', array()),
array(
import java.util.Random;
import java.io.*;
class Mondai19_3{
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
boolean undone=true;
Random rand=new Random();
while(undone){
int my=0;