Skip to content

Instantly share code, notes, and snippets.

@sangheestyle
sangheestyle / main.go
Created November 11, 2023 04:27
Click given image on screen.
package main
import (
"fmt"
"log"
"os"
"github.com/go-vgo/robotgo"
"github.com/vcaesar/bitmap"
)
@sangheestyle
sangheestyle / README.md
Last active July 13, 2023 15:36
Using ORT for dependency graph

Requirements should be installed manually. For example, pip install git+https://github.com/nexB/python-inspector should be required for generating dependency graph for python.

$ ./cli/build/install/ort/bin/ort requirements

After installation, analyze will generate dependency graph for python, node, and etc.

$ ./cli/build/install/ort/bin/ort --info analyze -f JSON -i ../test-oss-analyzer -o ../analyzer
@sangheestyle
sangheestyle / README.md
Created September 8, 2022 07:00
Optimize 사용 관련된 내용들

옵티마이즈 Optimize 사용 관련된 내용들

TODO

다뤄져야 할 키워드들

Datalayer events

experiment_impression

@sangheestyle
sangheestyle / main.js
Created April 30, 2019 18:27
callback, promise, async in JS
var request = require('request');
function requestUrl(url) {
return new Promise((resolve, reject) => {
request(url, (error, response, body) => {
if (error) {
reject(error);
} else {
resolve(response);
}
@sangheestyle
sangheestyle / readme.md
Last active March 29, 2019 15:50
rabbit

Using RabbitMQ

Running RabbitMQ on your local

Run the following script.

$ docker run -d --hostname my-rabbit --name some-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management
@sangheestyle
sangheestyle / coro_life.py
Created February 17, 2019 15:19 — forked from ramalho/coro_life.py
John Conway's Game of Life implemented with coroutines, by Brett Slatkin
#!/usr/bin/env python3
# Copyright 2014 Brett Slatkin, Pearson Education Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@sangheestyle
sangheestyle / orc.py
Created February 10, 2019 14:08
Create and delete pods on kubernetes via Python kubernetes API
"""
Intuition:
Assume we have pod1 and pod2 in 'default' namespace, and
we want to create and delete pod1 or pod2 on the fly.
Also, we can monitor their status on the fly.
Extention:
If our intuition works on kubernates python API, then
@sangheestyle
sangheestyle / task-scheduler.py
Created February 2, 2019 11:20
leetcode: 621. Task Scheduler
# time: O(nlogk) -> O(nlog1) ~ O(n)
# space: O(26) -> O(1)
from collections import Counter
class Solution:
def leastInterval(self, tasks, n):
"""
:type tasks: List[str]
@sangheestyle
sangheestyle / just.ts
Created January 16, 2019 17:37
just ts typing experiement
import { any } from 'ramda';
class DbError extends Error {
constructor(message: string) {
super(message);
// Set the prototype explicitly.
Object.setPrototypeOf(this, DbError.prototype);
}
}
@sangheestyle
sangheestyle / step1-curried.js
Last active November 26, 2018 22:06
Curried function for request promise
const rp = require('request-promise');
// A curried function
const fetch = (serverUrl) =>
(endpointPath) =>
async (id) => {
const options = {
uri: `${serverUrl}/${endpointPath}/${id}`,
json: true,
// some of common settings