Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/evdev.c b/src/evdev.c
index f627fd0..76bdeb6 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1755,7 +1755,7 @@ EvdevAddButtonClass(DeviceIntPtr device)
labels = malloc(pEvdev->num_buttons * sizeof(Atom));
EvdevInitButtonLabels(pEvdev, pEvdev->num_buttons, labels);
- if (!InitButtonClassDeviceStruct(device, pEvdev->num_buttons, labels,
+ if (!InitButtonClassDeviceStruct(device, ArrayLength(pEvdev->btnmap), labels,
import 'symbol-observable';
import * as Observable from 'zen-observable';
type Reducer<TAction, TState> = (state: TState, action: TAction) => TState;
type Delegate<TAction> = (action: TAction) => void;
type Middleware<TAction> = (action: TAction, next: Delegate<TAction>) => void;
class Dispatcher<TAction> implements Subscribable<TAction> {
private _observers: Set<Observer<TAction>>;
diff --git a/src/rxvtfont.C b/src/rxvtfont.C
index 1914539..4c0189e 100644
--- a/src/rxvtfont.C
+++ b/src/rxvtfont.C
@@ -1223,92 +1223,63 @@ rxvt_font_xft::load (const rxvt_fontprop &prop, bool force_prop)
return false;
int ftheight = 0;
- bool success = true;
-
function removeFromArray(array, element) {
var index = array.indexOf(element);
if (index !== -1) {
array.splice(index, 1);
}
}
function publish(source) {
return new ConnectableObservable(source, new Subject())
}
@emonkak
emonkak / Boards.plist
Created October 7, 2015 07:26
GraffitiPot board definition for 2ch.sc
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>boardFolderName</key>
<string>ベータテスト</string>
<key>child</key>
<array>
<dict>
@emonkak
emonkak / yui.markdown
Last active August 29, 2015 14:12
Yui language

Yui language

Interface definition

interface IEqualable<A> {
    (==)(this: IEqualable<A>, other: IEqualable<A>): Bool
}
@emonkak
emonkak / FizzBuzz.cs
Last active August 29, 2015 14:08
FizzBuzz.cs
using System;
using System.Collections;
using System.Collections.Generic;
public interface Optional<T> : IEnumerable<T>
{
T GetOrElse(T other);
T GetOrElse(Func<T> f);
Optional<T> OrElse(Optional<T> other);
Optional<T> OrElse(Func<Optional<T>> f);
@emonkak
emonkak / BogoSort.hs
Created August 16, 2014 10:11
BogoSort.hs
import Control.Monad
import Control.Monad.ST
import Data.Array.MArray
import Data.Array.ST
import System.Random
swap :: (MArray a e m, Ix i) => a i e -> i -> i -> m ()
swap array i j = do
tmp <- readArray array i
writeArray array i =<< readArray array j
@emonkak
emonkak / FizzBuzz.hs
Created May 10, 2014 18:18
FizzBuzz.hs
{-# Language TypeFamilies, DataKinds, KindSignatures, TypeOperators, UndecidableInstances, ScopedTypeVariables #-}
module Main where
import Data.Proxy
import Data.Type.Equality
import GHC.TypeLits
data FB = NumberT Nat | FizzT | BuzzT | FizzBuzzT
@emonkak
emonkak / NGram.hs
Created February 23, 2014 05:07
NGram.hs
{-# LANGUAGE OverloadedStrings #-}
import Data.Char (isSpace)
import qualified Data.Text as T
import qualified Data.Text.IO as T
ngram :: Int -> T.Text -> [T.Text]
ngram n = filter ((==) n . T.foldl' step 0) . map (T.take n) . T.tails
where