Skip to content

Instantly share code, notes, and snippets.

@otwm
otwm / gist:3a6358e53ca794cc2e57ade4af91d3bb
Last active January 27, 2021 04:16
ramda - argument null change
// infra code
const isEmptyOrNil = (value) => isEmpty(value) || isNil(value)
const nullChange = (defaultValue) => (value) => isEmptyOrNil(value)? defaultValue: value
// single null
const _somef = (value) => value
const somefWithDefault = (defaultValue) => pipe(nullChange(defaultValue), _somef)
const somef = somefWithDefault('myValue')
somef(null)
@otwm
otwm / gist:1a0a7b758cb102c098eb2cb79f6e7834
Created July 8, 2019 12:33
node-gyp 설치 오류(sentry)
일부 패키지 설치시 오류가 발생할 수 있다. 패키지 내에 c/c++ 라이브러리를 설치하는 경우 권한에 따른 에러가 발생하게 된다.
sentry 역시 그렇다. 로컬에선 별 문제 없다가 aws에서 문제가 발생한다.
설치 과정에서 추적하다보면 node scripts/install.js 라인에서 발생하고, 해당 디버그 메세지는 아래와 같다.
================================================================================================================
2916 info lifecycle @sentry/cli@1.46.0~install: @sentry/cli@1.46.0
2917 verbose lifecycle @sentry/cli@1.46.0~install: unsafe-perm in lifecycle false
2918 verbose lifecycle @sentry/cli@1.46.0~install: PATH: /opt/elasticbeanstalk/node-install/node-v8.14.0-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/tmp/deployment/application/node_modules/@sentry/cli/node_modules/.bin:/tmp/deployment/application/node_modules/.bin:/opt/elasticbeanstalk/node-install/node-v8.14.0-linux-x64/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
2919 verbose lifecycle @sentry/cli@1.46.0~install: CWD: /tmp/deployment/application/node_modules/@sentry/cli
2920 silly l
@otwm
otwm / git version next
Created January 26, 2019 13:20
next version
npm version patch -m "Version %s - add sweet badges"
git push && git push --tags (or git push origin master --tags)
npm publish
https://codeburst.io/https-chidume-nnamdi-com-npm-module-in-typescript-12b3b22f0724
https://stackoverflow.com/questions/29388626/how-to-speed-up-webstorm
Here is my recipe how to speed up your lovely WebStorm:
Go to Preferences and do next:
Appearance & Behaviour > System Settings > Updates: disable auto update
Appearance & Behaviour > System Settings > Usage Statistics: Uncheck Allow sending data usage statistics to JetBrains
Editor > Live Templates: disable all, leave only what you are really use
Editor > Emmet: disable all emmets
Editor > Intentions: I leave only: CSS, Declaration, JavaScript and Language Injection
git log --graph --full-history --all --pretty=format:"%h%x09%d%x20%s"
for file in *.JPG
do
mv -v "$file" "${file%.JPG}.jpg"
done
# (전체)보안 업그레이드
sudo apt-get full-upgrade
# 고정 ip 할당
sudo vim /etc/network/interfaces
==================================================
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
@otwm
otwm / DatabaseConfig.java
Last active April 13, 2018 16:30
entityManager, jpa query factory expose
package kr.co.rebel9;
import com.querydsl.jpa.impl.JPAQueryFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@otwm
otwm / mount
Created October 24, 2016 05:00
sudo vim /etc/fstab
//192.168.0.105/data /mnt/data cifs user=admin,pass=rebel9,rw 0