Skip to content

Instantly share code, notes, and snippets.

View thirdj's full-sized avatar

Choi, Jaehee thirdj

View GitHub Profile
var checkStrongPassword = function(_secureLevel, _pw){
var level1 = /^([a-zA-Z]).{6,24}/gi;
var level2 = /^(?!.*(.)\1{3})([a-zA-Z]).{8,24}/gi;
var level3 = /^(?!.*(.)\1{3})((?=.*[\d])(?=.*[A-Z])(?=.*[a-z])(?=.*[^\w\d\s])).{8,24}$/g;
var check = {
'keymap': false
};
var keymaps = /123|234|345|456|567|678|789|890|901|012/;
if (!_pw.match(keymaps)) check.keymap = true;
if (_secureLevel == 'l') {
@thirdj
thirdj / typeofCheck.js
Created October 13, 2013 08:08
type check func classof
function classof(o){
if (o === null) return 'Null';
if (o === undefined) return ' Undefined';
return Object.prototype.toString.call(o).slice(8,-1);
}
/*
* use: classof(false); // 'Boolean'
*/
@thirdj
thirdj / enter.js
Created October 11, 2013 00:52
enter plugin
$.fn.enter = function(handler) {
return this.live("keypress", function(e) {
if (e.which == 13) {
e.preventDefault();
if (handler) {
$(this).bind("enter", handler);
$(this).trigger("enter");
$(this).unbind("enter");
}
}
var getParam = function( name ) {
var result = '';
var thisUrl = unescape(location.href);
var params = thisUrl.substring(thisUrl.indexOf('?')+1).split('&');
for(var i = 0 ; i < params.length ; i++){
var keyValue = params[i].split('=');
if(keyValue[0].toUpperCase() == name.toUpperCase()){
result = keyValue[1];
break;
}
@thirdj
thirdj / kakaotalk.js
Created September 21, 2013 09:29
From http://mytory.net/archives/1563 카카오톡 링크 보내기
<a href="kakaolink://sendurl?msg=this-is-message&url=http://mytory.net&appid=mytory&appver=0.1">카카오톡으로 보내기</a>
var isIE11 = !!navigator.userAgent.match(/Trident\/7\./)
if (isIE11 == true) {
return "ie";
}
@thirdj
thirdj / css_center.css
Created August 30, 2013 02:36
css 가운데 정렬 From http://jsfiddle.net/mBBJM/1/
div{
background: red;
bottom: 0;
height: 100px;
left: 0;
margin: auto;
position: absolute;
top: 0;
right: 0;
width: 100px;
<!DOCTYPE html>
<meta charset="utf-8" />
<title>WebSocket Test</title>
<script language="javascript" type="text/javascript">
var wsUri = "ws://echo.websocket.org/";
var output;
function checkStrongPassword(pw){
var msg3 = '33333333';
var check = {
'length': false,
'charac': {
'upper': false,
'lower': false,
'special': false
},
#d {
width: 100px; height: 100px;
background-color: #eee;
border: 10px solid yellow;
outline: 10px solid red;
cursor: pointer;
text-align: center;
position: relative;
}