更新: | 2014-04-10 |
---|---|
バージョン: | 0.2.1 |
作者: | @voluntas |
URL: | http://voluntas.github.io/ |
reltool 周りについて勉強がてらまとめてみました
/** | |
* 半角カナを全角カナに変換する | |
* 半角スペースは変換しない | |
* 対応がとれない濁点、半濁点は変換しない | |
*/ | |
function toKanaZenkaku(str) { | |
// lengthの等しい2つの文字列でkey-valueをつくる | |
const makeMap = (str1, str2) => | |
str1 | |
.split("") |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/* | |
* MCrypt API available online: | |
* http://linux.die.net/man/3/mcrypt | |
*/ | |
#include <mcrypt.h> |
// Doing AES-256-CBC (salted) decryption with node.js. | |
// This code is based on http://php.net/manual/de/function.openssl-decrypt.php and works with PHP sqAES. | |
// | |
// Create your encrypted data with | |
// echo -n 'Hello world' | openssl aes-256-cbc -a -e | |
var crypto = require('crypto'); | |
var password = 'password'; | |
var edata = 'U2FsdGVkX18M7K+pELP06c4d5gz7kLM1CcqJBbubW/Q='; |
{sys, [ | |
{lib_dirs, ["../deps"]}, %% depsを追加 | |
{erts, [{mod_cond, derived}, {app_file, strip}]}, | |
{app_file, strip}, | |
{rel, "hogeapplication", "0.1", | |
[ | |
%% 標準で使うライブラリも全て追加 | |
kernel, | |
stdlib, | |
sasl, |
// Inspired by https://github.com/logicalparadox/backbone.iobind/blob/master/lib/sync.js | |
// Overwrite Backbone.sync method | |
Backbone.sync = function(method, model, options){ | |
// create a connection to the server | |
var ws = new WebSocket('ws://127.0.0.1:1234'); | |
// send the command in url only if the connection is opened | |
// command attribute is used in server-side. | |
ws.onopen = function(){ |
更新: | 2014-04-10 |
---|---|
バージョン: | 0.2.1 |
作者: | @voluntas |
URL: | http://voluntas.github.io/ |
reltool 周りについて勉強がてらまとめてみました
(function () { | |
MyApp.AlertView = Backbone.View.extend({ | |
tagName: "div", | |
className: "alert fade", | |
template: ["<a href=\"#\" data-dismiss=\"alert\" class=\"close\">×</a>", "<strong>{{ title }}</strong>", "{{ message }}"].join("\n"), |
# A simple CMake script for building the application. | |
cmake_minimum_required(VERSION 2.8) | |
project(create-x509) | |
# Our only dependency is OpenSSL | |
find_package(OpenSSL REQUIRED) | |
include_directories(${OPENSSL_INCLUDE_DIR}) | |
add_executable(create-x509 create-x509.cpp) |
-module(bench). | |
-export([run_suite/3, run/1]). | |
run_suite(Name, Passes, Messages) -> | |
Results = run_suite1(Passes, Messages, []), | |
Avg = lists:sum(Results) / Passes, | |
StdDev = math:sqrt(lists:sum([math:pow(X - Avg, 2) || X <- Results]) / Passes), | |
Summary = [{avg, Avg}, {stddev, StdDev}, {min, lists:min(Results)}, | |
{max, lists:max(Results)}], |