Skip to content

Instantly share code, notes, and snippets.

@JohnBaek
JohnBaek / Ajax_Responsing_In_WebForms.cs
Last active June 28, 2016 07:44
C#_Ajax_Responsing_In_WebForms.cs
using System;
using System.Net;
using System.Collections.Generic;
using System.Web;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Script.Serialization;
@JohnBaek
JohnBaek / C#_Make_Random_ListOrder.cs
Last active June 28, 2016 07:45
C#_Make_Random_ListOrder.cs
private List<string> GetShuffledArray(List<string> array)
{
List<string> result =
new List<string>();
Random r = new Random();
while (array.Count > 0)
{
int i = r.Next(array.Count);
@JohnBaek
JohnBaek / C#_Read_Json_and_Convert.cs
Created June 28, 2016 07:57
C#_Read_Json_and_Convert.cs
//json Read
using (StreamReader sr = new StreamReader(Server.MapPath("/%{serverPath}")))
{
string json = sr.ReadToEnd();
marbles = Newtonsoft.Json.JsonConvert.DeserializeObject<List<object>>(json);
}
@JohnBaek
JohnBaek / JS_HanbitOn_Mobile_Header.js
Created June 30, 2016 05:40
JS_HanbitOn_Mobile_Header.js
function HanbitOnMobileHeader() {
this._game = decodeURI(this.getQueryString("Game"));
this._titleUrl = decodeURI(this.getQueryString("Turl"));
};
HanbitOnMobileHeader.prototype.init = function()
{
this.createDiv("mHead", "mHead", this.getHeaderTable());
};
HanbitOnMobileHeader.prototype.getQueryString = function(name) {
var url = document.getElementById("hanbitOnMobielHeaderScript").src;
@JohnBaek
JohnBaek / JS_Paging.js
Created July 4, 2016 23:45
JS_Paging.js
//페이징 구현부
//totalCount 서버로부터부여받은 전체 갯수
//currPosition 현재 페이지 위치
function getPaginate(totalCount,currPosition,showListCount){
var paginate = "";
var maxLinkCount = 10; //링크숫자 보여줄 최대갯수
var lastPosition = 0; //마지막 링크 페이지
var startPosition = 0; //페이징이 시작될 위치
var totalPageCount = 0; //전체페이징 갯수
@JohnBaek
JohnBaek / JS_Jsonp_implement.js
Created July 6, 2016 00:39
JS_Jsonp_implement.js
var that = {};
that.send = function(src, options) {
var callback_name = options.callbackName || 'callback',
on_success = options.onSuccess || function(){},
on_timeout = options.onTimeout || function(){},
timeout = options.timeout || 10; // sec
var timeout_trigger = window.setTimeout(function(){
window[callback_name] = function(){};
@JohnBaek
JohnBaek / JS_string_to_array.js
Last active July 6, 2016 05:14
JS_string_to_array.js
<html>
<head>
<script>
var Draw = function() {
this.str = new Array();
};
Draw.prototype.layout = function(){
var a = this.str;
@JohnBaek
JohnBaek / C#_local_db_Create.cs
Last active July 6, 2016 05:14
C#_local_db_Create.cs
Run cd .. to move back up to the project directory
Run the following commands in the command prompt:
dotnet ef migrations add Initial
dotnet ef database update
@JohnBaek
JohnBaek / JS_Daum_Gnb.js
Last active July 6, 2016 05:14
JS_Daum_Gnb.js
function appendCss() {
var b = "HEADERCSS";
var a = document.createElement("link");
a.rel = "Stylesheet";
a.href = "http://game.daum.net/css/header.css";
a.type = "text/css";
a.charset = "utf-8";
document.getElementsByTagName("head")[0].appendChild(a)
}
@JohnBaek
JohnBaek / eventvwr_keyword_filtering.evtx
Last active July 7, 2016 07:52
eventvwr_keyword_filtering.evtx
<QueryList>
<Query Id="0" Path="file://C:\Users\john123\Desktop\test.evtx">
<Select Path="file://C:\Users\john123\Desktop\test.evtx">*[EventData[(Data='/pay/common/BillingResult.aspx')]]</Select>
</Query>
</QueryList>
//엑셀 추출 메서드
=MID(B1121,FIND(" User host address:",B1121,1)+19,15)