Skip to content

Instantly share code, notes, and snippets.

View minoki's full-sized avatar

ARATA Mizuki minoki

View GitHub Profile
@minoki
minoki / foo.cpp
Last active August 29, 2015 14:13
#include <cstdio>
class Foo
{
int x;
public:
Foo(int x);
~Foo();
void greet();
};
Foo::Foo(int x) : x(x)
// gcd a b | a`mod`b == 0 = b
// | otherwise = gcd b (a`mod`b)
#define GCD(a,b) (GCD1((a),(b)))
#define GCD1(a,b) a%b==0?b:GCD2(b,(a%b))
#define GCD2(a,b) a%b==0?b:GCD3(b,(a%b))
#define GCD3(a,b) a%b==0?b:GCD4(b,(a%b))
#define GCD4(a,b) a%b==0?b:GCD5(b,(a%b))
#define GCD5(a,b) a%b==0?b:GCD6(b,(a%b))
/*
bind1 :: (a -> b) -> a -> b
bind1 f t0 = f t0
*/
template<typename R, typename F, typename T0>
struct bind1_impl {
bind1_impl(F f,T0 t0):f(f),t0(t0){}
template<typename... T>
R operator()(T... t) {
return static_cast<R>(f(t0, t...));
var CSSMatrix;
if (navigator.userAgent.indexOf("Gecko") !== -1 && navigator.userAgent.indexOf("KHTML") === -1) {
CSSStyleDeclaration.prototype.__defineGetter__("borderRadius",function() {
return this.MozBorderRadius;
});
CSSStyleDeclaration.prototype.__defineSetter__("borderRadius",function(x) {
this.MozBorderRadius = x;
});
CSSStyleDeclaration.prototype.__defineGetter__("userSelect",function() {
local assert,error,setmetatable,tonumber = assert,error,setmetatable,tonumber
local table = require "table"
local io = require "io"
local lxp = require "lxp"
local base64 = require "base64"
module "propertylist"
array_metatable = {}
dictionary_metatable = {}
require "cocoa"
local filename = arg[1]
if not filename then
return
end
local ishtml = false
if filename:match("%.html$") then
ishtml = true