Skip to content

Instantly share code, notes, and snippets.

View snaiper80's full-sized avatar

Lee GiTack snaiper80

View GitHub Profile
@snaiper80
snaiper80 / look_and_say_seq.go
Created May 6, 2019 14:32
look_and_say_seq.go
package main
import (
"fmt"
)
/*
"Look and say" sequence (보고 말하는 수열) 다음과 같습니다.
1 - 1개의 1
@snaiper80
snaiper80 / least_sum.go
Last active April 30, 2019 01:31
mail-programming 35 solution
/*
단방향 연결 리스트(singly linked list)가 주어지면 총 합이 0으로 되는 연결된 노드들을 뺀 뒤 남은 노드의 값을 프린트 하시오.
Given a linked list, remove consecutive nodes that sum to zero. Print the values of leftover nodes.
input: 3 -> (-5) -> 5 -> 1 -> 2 -> 3
output: 3 -> 1 -> 2 -> 3
input: 1 -> 2 -> 3 -> 4 -> (-10) -> 5
output: 5
@snaiper80
snaiper80 / sv23.rb
Last active July 31, 2018 01:48
문제 23
# 정수 배열과 정수 k가 주어지면 모든 원소를 k칸씩 앞으로 옮기시오.
# input: [1, 2, 3, 4, 5], k = 2
# output: [3, 4, 5, 1, 2]
# input: [0, 1, 2, 3, 4], k = 1
# output: [1, 2, 3, 4, 0]
# 시간복잡도와 공간복잡도를 최대한 최적화 하시오.
@snaiper80
snaiper80 / gist:fef41b21d32afe60ed4c040393ea7a69
Created August 17, 2017 03:12 — forked from mikeyk/gist:1329319
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
@snaiper80
snaiper80 / docker_cheat.md
Created August 3, 2017 05:27 — forked from nacyot/docker_cheat.md
도커(Docker) 치트 시트

Docker 치트 시트

한국어 번역(초벌) : nacyot

왜 Docker를 사용해야하는가?

Why Should I Care (For Developers)

"나에게 Docker의 매력은 간단히 격리된 환경을 만들 수 있다는 것과, 그러한 환경을 재사용할 수 있다는 점이다."런타임 환경을 한 번 만들어 패키지로 만들면, 이 패키지를 다른 어떤 머신에서도 다시 사용할 수 있다. 또한 여기서 실행되는 모든 것은 마치 가상머신과 같이 호스트로부터 격리되어있다. 무엇보다도 이런 모든 일들이 빠르고 간단히 가능하다.

@snaiper80
snaiper80 / introrx.md
Created March 17, 2017 05:10 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@snaiper80
snaiper80 / gw-kit.sh
Created July 1, 2016 05:13
kerberos 인증 및 rlogin을 위한 gateway용 스크립트
#!/bin/bash
#==============================================================================
# GW-Kit
# @author : yunsang.choi([email protected])
# @src : https://gist.github.com/gists/3115022
#-------
# v1.3.4
# - minor change (display text)
# v1.3.3
# - allow '-' character in hostname
@snaiper80
snaiper80 / hbase.rest.scanner.filters.md
Created May 27, 2016 05:52 — forked from stelcheck/hbase.rest.scanner.filters.md
HBase Stargate REST API Scanner Filter Examples

Stargate Scanner Filter Examples

Introduction

So yeah... no documentation for the HBase REST API in regards to what should a filter look like...

So I installed Eclipse, got the library, and took some time to find some of the (seemingly) most useful filters you could use. I'm very green at anything regarding HBase, and I hope this will help anyone trying to get started with it.

What I discovered is that basically, attributes of the filter object follow the same naming than in the documentation. For this reason, I have made the link clickable and direct them to the HBase Class documentation attached to it; check for the instantiation argument names, and you will have your attribute list (more or less).

@snaiper80
snaiper80 / Install Ruby and RubyGems
Created January 19, 2016 06:53 — forked from chiraggude/Install Ruby and RubyGems
Install Ruby 2.1.1 and RubyGems 1.8.25 on CentOS 6.5
# Install Ruby
wget http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.1.tar.gz
tar xvzf ruby-2.1.1.tar.gz
cd ruby-2.1.1
./configure --prefix=/usr
make
make install
# remove "ruby-2.1.1" folder in /root
@snaiper80
snaiper80 / refc_leak.erl
Created October 30, 2015 06:46 — forked from ferd/refc_leak.erl
Find Erlang processes that may be leaking refc binaries
f(MostLeaky).
MostLeaky = fun(N) ->
lists:sublist(
lists:usort(
fun({K1,V1},{K2,V2}) -> {V1,K1} =< {V2,K2} end,
[try
{_,Pre} = erlang:process_info(Pid, binary),
erlang:garbage_collect(Pid),
{_,Post} = erlang:process_info(Pid, binary),
{Pid, length(Post)-length(Pre)}