Skip to content

Instantly share code, notes, and snippets.

View suhanlee's full-sized avatar
:octocat:
Focusing

kyle suhanlee

:octocat:
Focusing
View GitHub Profile
@suhanlee
suhanlee / http_redirect.go
Created September 21, 2017 17:52
http_redirect.go
package main
import (
"net/http"
"fmt"
)
func writeExample(w http.ResponseWriter, r *http.Request) {
str := `<html>
<head><title>hello</title></head>
@suhanlee
suhanlee / file_upload.go
Created September 21, 2017 17:37
file_upload.go
package main
import (
"net/http"
"io/ioutil"
"fmt"
)
func process_multipart_form(w http.ResponseWriter, r *http.Request) {
r.ParseMultipartForm(1024)
@suhanlee
suhanlee / form1.go
Last active March 21, 2019 01:45
http
package main
import (
"net/http"
"fmt"
)
func process(w http.ResponseWriter, r *http.Request) {
r.ParseForm()
fmt.Fprintln(w, r.Form)
require 'thread'
require 'json'
require 'fiber'
require 'eventmachine'
require 'em-http-request'
module Async
class Request
attr_accessor :url, :body
@suhanlee
suhanlee / example1.rb
Last active August 25, 2017 10:06
simple-em-synchrony-http-example
require 'pp'
require 'em-synchrony'
require 'em-synchrony/em-http'
require 'em-synchrony/fiber_iterator'
POST_URL = "http://localhost:4567/post_test"
GET_URL = "http://localhost:4567/get_test"
EM.synchrony do
1.times do |n|
@suhanlee
suhanlee / create_user_db.sh
Created May 10, 2017 16:08
PostgreSQL Script
* create postgresql user
$ createuser -P -d -e [user]
* create database on user
$ createdb -O [user] [user_database_name]
@suhanlee
suhanlee / fluent.conf
Last active May 12, 2017 09:30
fluentd/fluent.conf
<match slack>
@type slack
webhook_url https://hooks.slack.com/services/XXXXXXXX
channel logs
username suhanlee
icon_emoji :ghost:
flush_interval 60s
message_keys messages
</match>
@suhanlee
suhanlee / ffserver.conf
Last active April 18, 2017 08:17
ffmpeg
Port 8090
# bind to all IPs aliased or not
BindAddress 0.0.0.0
# max number of simultaneous clients
MaxClients 1000
# max bandwidth per-client (kb/s)
MaxBandwidth 100000
<Feed feed1.ffm>
File /tmp/feed1.ffm
@suhanlee
suhanlee / Gemfile
Created April 5, 2017 18:15
rails-capybara
group :development, :test do
gem 'capybara'
gem 'selenium-webdriver', '~> 3.3.0'
end
@suhanlee
suhanlee / layout01.js
Created January 5, 2017 07:16
React-native layout exam1
import React, { Component } from 'react';
import { StyleSheet, AppRegistry, Text, TextInput, View } from 'react-native';
class Hello extends Component {
render() {
return (
<View style={styles.layout}>
<Text>번호를 입력하세요</Text>
<View style={{width: 200, height: 50, backgroundColor: 'skyblue'}}>
<TextInput style={styles.item}