Skip to content

Instantly share code, notes, and snippets.

View cosmo0920's full-sized avatar
🏠
Working from home

Hiroshi Hatake cosmo0920

🏠
Working from home
View GitHub Profile
@cosmo0920
cosmo0920 / openjpeg_formula_update_to_2_0_0.patch
Created April 13, 2014 14:43
openjpeg Formula update patch
diff --git a/Library/Formula/openjpeg.rb b/Library/Formula/openjpeg.rb
index cbd6bbb..14c8d98 100644
--- a/Library/Formula/openjpeg.rb
+++ b/Library/Formula/openjpeg.rb
@@ -2,18 +2,19 @@ require 'formula'
class Openjpeg < Formula
homepage 'http://www.openjpeg.org/'
- url 'https://openjpeg.googlecode.com/files/openjpeg-1.5.1.tar.gz'
- sha1 '1b0b74d1af4c297fd82806a9325bb544caf9bb8b'
@cosmo0920
cosmo0920 / test-utf8-symbol.hs
Created March 11, 2014 02:58
UTF-8文字でも解釈可能らしい
{-# LANGUAGE UnicodeSyntax #-}
import Data.Ratio
type ℤ = Integer
type ℚ = Ratio ℤ
type 𝔹 = Bool
@cosmo0920
cosmo0920 / hs-groonga-main.hs
Created January 12, 2014 18:44
hsc2hsで生成したバインディングを使うと全然関数型らしくないものができてしまった(途中)
import Bindings.Groonga
import Foreign.C.String
import Foreign.C.Types()
import Foreign.Ptr
import Foreign.Storable()
import System.Directory
main :: IO ()
main = do
-- init context
@cosmo0920
cosmo0920 / waku_work_controller_spec.patch
Last active January 1, 2016 20:29
waku work controller spec
diff --git a/server/spec/app/controllers/action_controller_spec.rb b/server/spec/app/controllers/action_controller_spec.rb
new file mode 100644
index 0000000..75ebee7
--- /dev/null
+++ b/server/spec/app/controllers/action_controller_spec.rb
@@ -0,0 +1,12 @@
+require 'spec_helper'
+
+describe "ActionController" do
+ context "when not login" do
@cosmo0920
cosmo0920 / Eff_hs_use_ghc_741.patch
Last active December 27, 2015 07:29
Eff.hs build log ghc 7.4.1で使うにはEff_hs_use_ghc_741.patchを当てる。
--- Eff.hs.orig 2013-11-04 00:40:54.049122147 +0900
+++ Eff.hs 2013-11-04 00:25:32.619144784 +0900
@@ -1,4 +1,5 @@
{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
@@ -11,6 +12,9 @@
module Eff where
@cosmo0920
cosmo0920 / XORCipher.cs
Last active December 25, 2015 20:59
XOR Cipher
using System;
using System.Text;
class program
{
static void Main(){
string key = (string)"\xde\xad\xbe\xef\01";
string str = "hogehoge", base64str, cryptedstr, decryptedstr;
byte[] bs;
@cosmo0920
cosmo0920 / ssltest.cabal
Last active December 23, 2015 09:49 — forked from nullren/ssltest.hs
-- Initial hs-IRC.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/
name: test
version: 0.1.0.0
-- synopsis:
description:
test SSL
license: MIT
-- license-file: LICENSE
#https://github.com/loarabia/Clang-tutorial
$ wget http://llvm.org/releases/3.0/llvm-3.0.tar.gz; tar xvf llvm-3.0.tar.gz
$ cd llvm-3.0.src/tools/
$ wget http://llvm.org/releases/3.0/clang-3.0.tar.gz; tar xvf clang-3.0.tar.gz
$ mv clang-3.0.src/ clang/ ; cd ../..; mkdir build; cd build
$ ../llvm-3.0.src/configure ; make install
@cosmo0920
cosmo0920 / Lens-Aeson-test.cabal
Last active December 22, 2015 12:39
Lens.Aeson
-- Initial Lens-Aeson-test.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/
name: Lens-Aeson-test
version: 0.1.0.0
-- synopsis:
-- description:
license: MIT
license-file: LICENSE
author: cosmo0920
@cosmo0920
cosmo0920 / output.log
Last active December 22, 2015 01:39
Aeson-Lens
% ./dist/build/test-aeson-lens/test-aeson-lens
"127.0.0.1"
"27017"