Skip to content

Instantly share code, notes, and snippets.

View henry0312's full-sized avatar
💭
I may be slow to respond.

OMOTO Tsukasa henry0312

💭
I may be slow to respond.
View GitHub Profile
@henry0312
henry0312 / BetaDistribution.hpp
Last active October 12, 2015 09:28
Beta Distribution
/*
* BetaDistribution.hpp
*
* Copyright (c) 2012 Tsukasa OMOTO <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
@henry0312
henry0312 / gist:4012616
Created November 4, 2012 17:07
pigoz/mplayer2/mplayer2
$ brew install --HEAD pigoz/mplayer2/mplayer2 --with-libav
==> Cloning git://git.mplayer2.org/mplayer2.git
Updating /Library/Caches/Homebrew/mplayer2--git
==> Checking out branch unstable
==> Generating VERSION from the Homebrew's git cache
==> ./configure --prefix=/usr/local/Cellar/mplayer2/HEAD --cc=cc --enable-macosx-bundle --enable-macosx-finder --enable-
==> make install
rst2man not found. You need the Docutils system to generate the manpages (preferably version >= 0.9; 0.8 and older are known to corrupt the arguments shown in some option descriptions). Alternatively you can use 'install-no-man' rule.
@henry0312
henry0312 / descriptive_statistics.rb
Created November 20, 2012 13:32
Descriptive statistics in Ruby
# Add methods to Enumerable, which makes them available to Array
module Enumerable
# sum of an array of numbers
def sum
return self.inject(0,:+)
end
# average of an array of numbers
def mean
--- lisp/term/ns-win.el.patched 2013-07-04 15:11:31.000000000 +0900
+++ lisp/term/ns-win.el 2013-07-04 15:11:47.000000000 +0900
@@ -1285,6 +1285,58 @@
(title . "半英")
(cursor-color)
(cursor-type))
+ ("com.justsystems.inputmethod.atok26.Japanese"
+ (title . "ひらがな")
+ (cursor-color)
+ (cursor-type))
ERROR: freetype2 not found
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
[email protected] mailing list or IRC #libav on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.
HOMEBREW_VERSION: 0.9.4
HEAD: 72cdbc66d8c07862fe904a5d9341079aaf89f105
#!/usr/bin/env ruby
require 'uri'
if ARGV.size != 1
warn "Invalid argument"
exit
end
methods = []
!
!=
!~
%
&
*
**
+
+@
-
<?php
/**
* Make php.dict for neosnippet.vim
*
* Require:
* PHP 5.4 or later
*
* Usage:
* php make_php_dict.php > php.dict
# vim: syntax=config
# https://github.com/pigoz/dotfiles/blob/master/mpv/config
################################################################################
# General
################################################################################
#use-filedir-conf=yes # load config file from file directory
correct-pts=yes
msgcolor=yes
@henry0312
henry0312 / controller
Created February 15, 2014 10:47
Inserting multiple rows on FuelPHP
public function action_index()
{
Model_Test::test(); exit;
}