##Example
stringFormat("{1},{0}","two","one")
//returns "one,two"
stringFormat("{1},{0}",["two","one"])
//returns "one,two"| javascript: (function(id, pw, redirect) { | |
| var form = document.createElement('form'); | |
| form.setAttribute("action", "https://dcid.dcinside.com/join/member_check.php"); | |
| form.setAttribute("method", "POST"); | |
| var data = | |
| [{name: "s_url", value: redirect}, | |
| {name: "ssl", value: "Y"}, | |
| {name: "user_id", value: id}, | |
| {name: "password", value: pw}]; |
##Example
stringFormat("{1},{0}","two","one")
//returns "one,two"
stringFormat("{1},{0}",["two","one"])
//returns "one,two"##Example
var a = 10, b = 20;
eval(_t)( "${a} * ${b} = ${a * b}" ); //in ES6 `${a} * ${b} = ${a * b}`
//returns "10 * 20 = 200"| ;(function (angular) { | |
| var app = angular.module('bj-module', []); | |
| /** | |
| * @example | |
| * <div require-checked tooltip="please select at least one"> | |
| * <input type="checkbox" name="chk" value="a"> | |
| * <input type="checkbox" name="chk" value="b"> | |
| * </div> | |
| */ | |
| app.directive('requireChecked', function () { //모든 경우에 쓸 수 있는 디렉티브. 체크박스가 한개 미만 선택시 툴팁 띄움 |
##Lotto generate algorithm
##Example
var p = new path('http://abc.com/aa/bb/cc');
p.cd('../../ww');
p.toString();
//returns "http://abc.com/aa/ww"
p.cd('/').toString();
//returns "http://abc.com"| var crypto = require('crypto'); | |
| var SHA256 = require('./SHA256.js'); | |
| var Base64 = require('./Base64.js'); | |
| var _key = SHA256.encode('default key'); | |
| module.exports = { | |
| encode: function (data, key) { | |
| if (arguments.length < 2) key = _key; | |
| var cipher = crypto.createCipher('aes-256-ctr', key); // Cipher 객체 생성 | |
| var crypted = Buffer.concat([cipher.update(new Buffer(data)), cipher.final()]); | |
| return Base64.encode(crypted); |