Skip to content

Instantly share code, notes, and snippets.

View zeroFruit's full-sized avatar
🎯
Focusing

JooHyung Kim zeroFruit

🎯
Focusing
View GitHub Profile
@longfin
longfin / writing.md
Last active May 26, 2023 09:22
엔지니어를 위한 글쓰기

이 글은 Heinrich Hartmann 님이 작성하신 글을 한국어로 번역한 것입니다. 원문은 https://www.heinrichhartmann.com/posts/writing/ 에서 확인하실 수 있습니다.


글쓰기는 큰 조직에서 영향력을 발휘하는 데 중요합니다. 경력 있는 소프트웨어 엔지니어로서의 글쓰기는 직무 범위를 확장하고 경력을 발전시키기 위해 획득해야 하는 가장 중요한 기술입니다.

글쓰기는 어렵습니다. 많은 소프트웨어 엔지니어들이 글쓰기와 씨름하죠. 저도 개인적으로 문학에 대한 관심이 없기 때문에 글쓰기가 자연스럽지 않았습니다.

@andromedarabbit
andromedarabbit / dl_hankyung.sh
Last active October 31, 2021 13:17
한경컨센서스에서 보고서 다운로드 받기
#!/bin/bash -e
TODAY=$(date '+%Y-%m-%d')
DOWNLOAD_DIR="${HOME}/Downloads/${TODAY}"
mkdir -p "${DOWNLOAD_DIR}"
type qpdf &>/dev/null || brew install qpdf
type recode &>/dev/null || brew install recode
curl -H 'Accept-Charset: euc-kr' --silent "http://consensus.hankyung.com/apps.analysis/analysis.list?&pagenum=800" | iconv -f euc-kr -t utf-8 | grep report_idx | while IFS= read -r LINE; do
using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.AI;
@AndreiD
AndreiD / sendRawTransaction.js
Last active November 12, 2023 15:13
Sends a raw transaction with web3 1.2.2, ethereumjs-tx, and Infura
# FOR ETHER ->
web3.eth.getTransactionCount(this.address).then(txCount => {
const txData = {
nonce: web3.utils.toHex(txCount),
gasLimit: web3.utils.toHex(100000),
gasPrice: web3.utils.toHex( YOUR_GAS_PRICE), // 10-15 gwei should be ok
to: this.toAddress,
from: this.address,
@smola
smola / k8s-jprofiler-attach.sh
Created March 23, 2018 14:49
Attach JProfiler agent to a JVM running in a Kubernetes pod
#!/bin/bash
set -e
if [[ -z ${K8S_JVM_POD} ]]; then
echo "K8S_JVM_POD not defined"
exit 1
fi
EXEC="kubectl exec ${K8S_JVM_POD}"
CP="kubectl cp ${K8S_JVM_POD}"
apiVersion: v1
kind: ConfigMap
metadata:
name: fluentd-config
namespace: fluentd
labels:
app: fluentd
data:
fluentd.conf: |
@include prometheus.conf
@nvgoldin
nvgoldin / asyncio_shutdown_loop.py
Created July 27, 2016 13:34
Python 3.5 asyncio - shutdown all tasks safely using signal handler
import signal
import functools
async def looping_task(loop, task_num):
try:
while True:
print('{0}:in looping_task'.format(task_num))
await asyncio.sleep(5.0, loop=loop)
except asyncio.CancelledError:
return "{0}: I was cancelled!".format(task_num)
@iamralch
iamralch / compress.go
Last active April 16, 2023 03:04
ZIP archives in Golang
import (
"archive/zip"
"io"
"os"
"path/filepath"
"strings"
)
func zipit(source, target string) error {
zipfile, err := os.Create(target)
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@icecrime
icecrime / gist:67399480c9a10b48fadc
Last active November 7, 2023 08:38
An experiment with Golang reflection and channels
package main
import (
"reflect"
"strings"
)
func makeChannel(t reflect.Type, chanDir reflect.ChanDir, buffer int) reflect.Value {
ctype := reflect.ChanOf(chanDir, t)
return reflect.MakeChan(ctype, buffer)