This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gcc aes_test.cpp -lcrypto | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <openssl/evp.h> | |
#include <openssl/aes.h> | |
void print_bytes(const uint8_t *bytes, const size_t len) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; deferred-loop-sample.el --- deferredを使った繰り返し処理のサンプル | |
;;; Commentary: | |
;; ~/tmp/に1.txt ~ 40.txtを作成する。(~/tmp/をあらかじめ作っておくこと) | |
;; deferred:parallelで並列処理するが、一度に作れるプロセスに上限があるため、 | |
;; 16個ずつに区切って繰り返し (deferredの再帰) で実行する。 | |
;;; Code: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# coding: utf-8 | |
#------------------------------------------------------------------------------- | |
# wripe_to_simplenote.rb | |
# wri.peからexportしたノートをsimplenoteに登録する | |
#------------------------------------------------------------------------------- | |
require './simplenote' | |
email = 'abc@exmaple.com' | |
password = 'password' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun dump-string (str) | |
(let ((i 0) ret) | |
(when (stringp str) | |
(while (< i (length str)) | |
(setq ret (if ret | |
(format "%s %x" ret (aref str i)) | |
(format "%x" (aref str i)))) | |
(setq i (1+ i)))) | |
ret)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COND_A = NO | |
COND_B = YES | |
all: | |
# AND condition | |
ifeq ($(COND_A) $(COND_B), YES YES) | |
@echo "A and B is true" | |
else | |
@echo "A and B is false" | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; init_for_c++11_coding.el --- Emacs settings for C++11 coding | |
;; Copyright (C) 2015 alpha22jp | |
;; Author: alpha22jp <alpha22jp@gmail.com> | |
;; Keywords: C++11 | |
;;; Commentary: | |
;;; Install yasnippet, company, irony, flycheck-irony and rtags from MELPA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (C) 2015 alpha22jp@gmail.com | |
// | |
#include <iostream> | |
#include <memory> | |
#include <string> | |
#include <unordered_map> | |
class IntObject { | |
public: | |
explicit IntObject(int val) : m_val(val) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Lens | |
import Control.Monad.State | |
import Data.List | |
type Point = (Int, Int) | |
type Board = [[Char]] | |
rowNum = 13 :: Int | |
colNum = 6 :: Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ScopedTypeVariables #-} | |
import Control.Exception | |
import Control.Monad.Trans.Error | |
import Control.Monad.IO.Class | |
import System.IO.Error | |
-- IO例外のみ捕捉できる | |
safeIOAction :: IO a -> ErrorT String IO a | |
safeIOAction action = do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import Network.HTTP hiding (urlEncode) | |
import Network.URI | |
import Data.Maybe | |
import Data.ByteString.Char8 as BS | |
import Data.ByteString.Base64 (encode) | |
token :: String -> String -> BS.ByteString | |
token email pass = encode . BS.pack $ urlEncodeVars [("email", email), ("password", pass)] |
NewerOlder