Skip to content

Instantly share code, notes, and snippets.

View KennethanCeyer's full-sized avatar
🚀

Sungmin Han KennethanCeyer

🚀
View GitHub Profile
@KennethanCeyer
KennethanCeyer / .bash_profile
Last active July 15, 2024 03:43
bash_profile for MAC users
#.bash_profile
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
#============================================================
#
# ALIASES AND FUNCTIONS
# Arguably, some functions defined here are quite big.
# If you want to make this file smaller, these functions can
@KennethanCeyer
KennethanCeyer / open_zshrc_on_mac.sh
Created February 3, 2017 17:29
Open zshrc file to note on Mac
open ~/.zshrc
@KennethanCeyer
KennethanCeyer / websocket-elb.md
Created September 9, 2016 13:47 — forked from zhiguangwang/websocket-elb.md
Configure websockets behind an AWS ELB.
@KennethanCeyer
KennethanCeyer / download_brogrammer.vim.sh
Created May 1, 2019 17:53
Download brogrammer.vim to .vim colors
mkdir -p ~/.vim/colors
curl https://raw.githubusercontent.com/marciomazza/vim-brogrammer-theme/master/colors/brogrammer.vim > ~/.vim/colors/brogrammer.vim
protected override void Initialize(RequestContext requestContext)
{
base.Initialize(requestContext);
string domain = Dns.GetHostEntry(this.Request.UserHostName).HostName;
string[] segments = domain.Split('.');
string subdomain = "";
if(segments.Length >= 3)
{
subdomain = segments[0];
@KennethanCeyer
KennethanCeyer / wpf_tabcontrol_selection_changed_problem.cs
Created October 6, 2015 18:05
WPF TabControl Selection Changed : The solution that problem calling those event infinitely.
private void MainTabChanged(object sender, SelectionChangedEventArgs e)
{
int tabItem = ((sender as TabControl)).SelectedIndex;
if (e.Source is TabControl) // This is a soultion of those problem.
{
switch (tabItem)
{
case 0: // Chatting
Debug.WriteLine("Tab: Chatting");
if (MainChatList.Items.Count > 0)
@KennethanCeyer
KennethanCeyer / Socket-packet-little-endian-and-big-endian.cs
Created October 1, 2015 01:27
About little endian and big endian when socket programing
private List<byte> bnetData = new List<byte>();
private BnetHelper bnetHelper = BnetHelper.getInstance();
public byte bnetCommand;
public int serverToken = 0;
public int clientToken = 0;
public BnetProtocol()
{
}
@KennethanCeyer
KennethanCeyer / check_shell.sh
Created May 1, 2019 15:53
Check your shell name
echo $0
@KennethanCeyer
KennethanCeyer / setting_zsh.sh
Created February 3, 2017 16:51
setting zsh to default shell
# Find zsh current path.
which zsh
# > /usr/local/bin/zsh
# Change shell to zsh.
# Do not use this command line with sudo.
chsh -s /usr/local/bin/zsh
@KennethanCeyer
KennethanCeyer / amd_commonjs_module_supports.js
Created March 4, 2017 22:55
Supporting AMD and CommonJS, and Plaintype.
(function(root, factory) {
if(typeof define !== 'undefined' && define.amd) {
// AMD loader type declaration.
define(['jquery', 'moment'], function(jquery, moment) {
factory(window, document, jquery, moment);
});
} else if(typeof module === 'object') {
var jsdom = require('jsdom').jsdom;
var _document = jsdom('<html></html>', {});
var _window = _document.defaultView;