Skip to content

Instantly share code, notes, and snippets.

View Elevista's full-sized avatar

Elevista

  • Yanolja
  • Seoul
View GitHub Profile
@Elevista
Elevista / README.md
Last active March 13, 2016 00:12
Lotto generate algorithm (C,C++,Java,Javascript,Python)

##Lotto generate algorithm

@Elevista
Elevista / README.md
Last active March 4, 2016 02:26
make random token

Usage

makeToken(10);
@Elevista
Elevista / angular-bj-module.js
Last active March 3, 2016 08:56
My angular utils
;(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 () { //모든 경우에 쓸 수 있는 디렉티브. 체크박스가 한개 미만 선택시 툴팁 띄움
@Elevista
Elevista / README.md
Last active March 4, 2016 06:57
ES5 Template literals

##Example

var a = 10, b = 20;
eval(_t)( "${a} * ${b} = ${a * b}" ); //in ES6 `${a} * ${b} = ${a * b}` 
//returns "10 * 20 = 200"
@Elevista
Elevista / README.md
Last active March 4, 2016 00:40
스트링 파라미터 치환

##Example

stringFormat("{1},{0}","two","one")
//returns "one,two"
stringFormat("{1},{0}",["two","one"])
//returns "one,two"
@Elevista
Elevista / dclogin.js
Last active December 9, 2015 06:41
디시인사이드 자동 로그인 북마클릿
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}];