Skip to content

Instantly share code, notes, and snippets.

View miaekim's full-sized avatar

Miae Kim miaekim

View GitHub Profile
@miaekim
miaekim / app.ts
Created March 20, 2021 03:27
use `aws-sdk` to fetch stack output
// utils.ts
import { CloudFormation, Output } from "@aws-sdk/client-cloudformation";
const getStackOutputs = async (stackName: string): Promise<Output[]> => {
const cfn = new CloudFormation({});
const result = await cfn.describeStacks({ StackName: stackName });
return result.Stacks![0].Outputs!;
};
@miaekim
miaekim / async.py
Last active November 20, 2018 19:52
Parallelized Code Sample
import asyncio
import time
import random
def addstr(name, start_time):
randint = random.randint(5, 7)
summ = str(sum(i * i for i in range(10 ** randint)))
print(f"SUM ({name} with randint {str(randint)}) {summ}: took {time.time() - start_time} sec")
return randint
@miaekim
miaekim / virtuso.py
Created December 29, 2017 04:28
Querying Virtuoso Example
#!/usr/bin/env python
#
# Demonstrating use of a single query to populate a # Virtuoso Quad Store via Python.
#
import json
import urllib.request
import urllib.parse
# HTTP URL is constructed accordingly with JSON query results format in mind.
@miaekim
miaekim / .zshrc
Created August 7, 2017 18:05
.zshrc
HISTFILE="$HOME/.zsh_history"
HISTSIZE=10000000
SAVEHIST=10000000
setopt BANG_HIST # Treat the '!' character specially during expansion.
setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history.
setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
@miaekim
miaekim / .bashrc
Created October 17, 2016 17:41
Git aliases for bash
# add this tothe .bashrc
if [ -f ~/.git_aliases ]; then
. ~/.git_aliases
fi

Keybase proof

I hereby claim:

  • I am miaekim on github.
  • I am miae (https://keybase.io/miae) on keybase.
  • I have a public key whose fingerprint is BBA4 88CA 022C 9663 835F 0282 ED5E A01B F892 6D98

To claim this, I am signing this object:

@miaekim
miaekim / daum-remove-comments-0.1.1.js
Last active August 29, 2015 14:23
다음 뉴스 comments 제거 user script
// ==UserScript==
// @name Remove comments in Daum News
// @version 0.1.1
// @description remove comment box in Daum News
// @match http://m.media.daum.net/*
// @match http://media.daum.net/*
// @author Miae Kim
// ==/UserScript==
(function() {
@miaekim
miaekim / sunday.m
Last active August 29, 2015 14:10
공컴프 일요일
function varargout = function_test(varargin)
% FUNCTION_TEST M-file for function_test.fig
% FUNCTION_TEST, by itself, creates a new FUNCTION_TEST or raises the existing
% singleton*.
%
% H = FUNCTION_TEST returns the handle to a new FUNCTION_TEST or the handle to
% the existing singleton*.
%
% FUNCTION_TEST('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in FUNCTION_TEST.M with the given input arguments.
@miaekim
miaekim / 1120
Last active August 29, 2015 14:10
1120
function varargout = test1(varargin)
% TEST1 M-file for test1.fig
% TEST1, by itself, creates a new TEST1 or raises the existing
% singleton*.
%
% H = TEST1 returns the handle to a new TEST1 or the handle to
% the existing singleton*.
%
% TEST1('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in TEST1.M with the given input arguments.
@miaekim
miaekim / gist:c8402d1621b85c6cae29
Created November 19, 2014 07:38
sparql_example
SELECT DISTINCT ?name ?wikiPageRevisionID ?label ?country
WHERE {
{ ?name a dbpedia-owl:Work . }
OPTIONAL { ?name dbpedia-owl:wikiPageRevisionID ?wikiPageRevisionID . }
OPTIONAL { ?name rdfs:label ?label . filter langMatches( lang(?label), "EN" )}
OPTIONAL { ?name dbpprop:country ?country . }
}
GROUP BY ?name
LIMIT 100