Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View VoQn's full-sized avatar
:shipit:
I may be slow to respond.

Kazuhiro Mizushima VoQn

:shipit:
I may be slow to respond.
View GitHub Profile
@VoQn
VoQn / mastodon_force_2_column_mode.css
Created May 29, 2017 12:03
mastodon の viewport-width が 1025px 以上だった時に無理やり2カラムに修正するやつ
@media screen and (min-width: 1025px) {
.tabs-bar {
display: flex;
}
.drawer__header,
.tabs-bar__link[href="/web/statuses/new"],
.columns-area>[role="region"] {
display: none;
}
.drawer {
@VoQn
VoQn / 呪い.hs
Last active August 29, 2015 14:05
「人を呪えば穴ふたつ」の論理を Haskell で実装したら居るはずのない死者が増え続けていく結果になった
module Main where
type People = Int -- 人間
type Grave = (Int, Int) -- 墓穴
呪う :: (People, People, Grave) -> (People, People, Grave)
呪う (0, 0, n) = (0, 0, n) -- 人間がいない
呪う (0, 1, (i, j)) = (0, 0, (i + 1, j + 1)) -- 死んでいくのみ
@VoQn
VoQn / 型って雄弁だね.hs
Last active September 23, 2023 14:16
まぁHaskellさんの真骨頂はモナド(あくまでも市井で言われてるようなレベルの話)より型と型クラスじゃないかなーと最近は思いますね
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
newtype FizzBuzz = FizzBuzz Int deriving (Enum, Eq, Ord, Num, Real, Integral)
instance Show FizzBuzz where
show x = (fizz ++ buzz) `or` show asInt where
fizz | ifMultipleOf 3 = "fizz" | otherwise = []
buzz | ifMultipleOf 5 = "buzz" | otherwise = []
ifMultipleOf n = x `mod` n == 0
or [] ys = ys
@VoQn
VoQn / quicksort.hs
Last active December 17, 2015 14:38
qsort xs = qsort' xs []
qsort' xs rs = case xs of
[] -> rs
[x] -> x:rs
(x:xs') ->
let m = median xs in qsort'' xs m rs [] [] []
qsort'' xs m rs ls es gs = case xs of
[] -> qsort' ls $ es ++ qsort' gs rs
@VoQn
VoQn / Billboard.cs
Created April 30, 2013 10:35
Unity3D でよくやる平面ビルボード 使い方は readme.md にて
using UnityEngine;
public class BillBoard : MonoBehaviour {
public Transform targetToFace;
public bool isAutoFace = true;
Quaternion adjustEuler = Quaternion.Euler (90, 180, 0);
// Use this for initialization
void Start ()
@VoQn
VoQn / DetonatorTest.cs
Created March 3, 2013 11:08
Detonator Explosion Framework が最新の Unity だとインポート時に DetonatorTest.js がコンパイルエラーを出しやがるので、差し替え用の C# 書いた。使い方は detonatorPrefabs にインスペクタで Detonator が用意しているアセットを全部突っ込めばよい
using UnityEngine;
using System.Collections;
public class DetonatorTest : MonoBehaviour {
public GameObject currentDetonator;
private int _currentExpIdx = -1;
private bool buttonClicked = false;
public GameObject[] detonatorPrefabs;
public float explosionLife = 10;
@VoQn
VoQn / gist:4212765
Created December 5, 2012 05:56
My SublimeText setting
{
//-- GUI Look & Feel --
"highlight_line": true,
"rulers": [ 80, 120 ],
// Source Code Pro - https://github.com/adobe/source-code-pro
"font_face": "Source Code Pro ExtraLight",
// for MacOS X
"font_options": [ "subpixel_antialias", "no_round" ],
i=0;while(100>i++){console.log(((i%3?'':'Fizz')+(i%5?'':'Buzz'))||i);}
@VoQn
VoQn / gist:3157701
Created July 22, 2012 00:26
nicobook.css
@@ -111, +111,113 @@
- min-width: 6em;
+ min-width: 6ex;
+ font-size: 16pt;
+ font-weight: bold;
@@ -265, +267 @@
- font-size: 1.5em;
+ font-size: 21pt;
@VoQn
VoQn / example_test.coffee
Created July 12, 2012 15:54
macchiato.js-v0.2.0 feature
people = require "../lib/people"
test_data =
Tom:
age: 15
gender: people.GENDER.MALE
Beth:
age: 15
gender: people.GENDER.FEMALE