Skip to content

Instantly share code, notes, and snippets.

View airglow923's full-sized avatar
🪖
National Service

Hyundeok Park airglow923

🪖
National Service
  • South Korea
  • 13:11 (UTC +09:00)
View GitHub Profile
@airglow923
airglow923 / init-ts-proj.sh
Last active February 12, 2021 02:29
Initialize TypeScript project with basic functionalities.
#!/bin/sh
# For optimum usage, you can git clone your remote repository before executing
# this script so that it is applied to package.json.
jq_inplace() {
# create temporary file
TEMP=$(mktemp)
# remove temoorary file in case the program terminates unexpectedly
@airglow923
airglow923 / swap-file.sh
Created December 24, 2020 05:02
Swap file using mv
#!/bin/sh
FILE1=$1
FILE2=$2
output_error() {
echo "$1"
1>&2;
exit 1;
}
@airglow923
airglow923 / jq-inplace.sh
Last active January 2, 2021 15:12
jq but edit json inplace
#!/bin/sh
# The first argument should be json string that would be fed into jq.
# The second argument should be json filename.
# create temporary file
TEMP=$(mktemp)
# remove temoorary file in case the program terminates unexpectedly
trap "{ rm -f $TEMP; }" EXIT
@airglow923
airglow923 / GenericSignature.ts
Last active January 6, 2021 12:59
Somewhat useless typescript code for generic but maybe useful in the future
const typePattern = /\s(.*)\]/;
interface GenericTaggable {
[Symbol.toStringTag]: string;
}
interface DefaultConstructible<T> {
new (): T;
}
@airglow923
airglow923 / move-only.h
Last active January 31, 2021 02:04
Move only C++ code example introduced by Ivan Čukić
#include <type_traits> // is_nothrow_constructible, is_nothrow_assignable
// is_nothrow_convertible, is_constructible
// is_assignable, is_convertible
#include <memory> // make_unique
#include <string> // operator""s
using namespace std::string_literals;
namespace detail {
/home/hyundeok/git/lsp-examples/vue/node_modules/vls/dist/vueServerMain.js:1
"use strict";var e=require("util"),t=require("path"),n=require("os"),r=require("crypto"),o=require("net"),i=require("url"),s=require("fs"),a=require("child_process"),c=require("./vls.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=u(e),d=u(t),f=u(n),h=u(r),p=u(o),g=u(i),m=u(s),y=u(a),v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function R(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}function b(e){var t={exports:{}};return e(t,t.exports),t.exports}var _=b((function(e,t){function n(e){return"string"==typeof e||e instanceof String}function r(e){return"function"==typeof e}function o(e){return Array.i
2021-02-26 11:51:35,769 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/home/hyundeok/.vim/plugged/YouCompleteMe/python/ycm/client/base_request.py", line 73, in HandleFuture
return _JsonFromFuture( future )
File "/home/hyundeok/.vim/plugged/YouCompleteMe/python/ycm/client/base_request.py", line 256, in _JsonFromFuture
raise MakeServerException( response.json() )
ycmd.responses.ServerError: RuntimeError: Server is initializing. Please wait.
2021-02-26 11:51:39,867 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/home/hyundeok/.vim/plugged/YouCompleteMe/python/ycm/client/base_request.py", line 73, in HandleFuture
2021-02-26 11:51:08,150 - ERROR - Error occurred while loading global extra conf /home/hyundeok/.vim/.ycm_extra_conf.py
Traceback (most recent call last):
File "/home/hyundeok/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/extra_conf_store.py", line 92, in _CallGlobalExtraConfMethod
module = Load( global_ycm_extra_conf, force = True )
File "/home/hyundeok/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/extra_conf_store.py", line 171, in Load
module = LoadPythonSource( _RandomName(), module_file )
File "/home/hyundeok/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/utils.py", line 377, in LoadPythonSource
return importlib.machinery.SourceFileLoader( name, pathname ).load_module()
File "<frozen importlib._bootstrap_external>", line 462, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 962, in load_module
serving on http://localhost:45201
@airglow923
airglow923 / webpack-babel-plugins
Created March 1, 2021 07:17
Useful Webpack and Babel plugins
webpack-merge \
css-loader \
thread-loader \
babel-loader \
case-sensitive-paths-webpack-plugin \
html-webpack-plugin \
copy-webpack-plugin \
mini-css-extract-plugin
@babel/cli \