Skip to content

Instantly share code, notes, and snippets.

@xx4159
xx4159 / main.scss
Last active August 29, 2015 14:17
Micro Clearfix - Scss 플레이스홀더(Placeholder)
//micro-clearfix.scss 모듈 호출
@import "micro-clearfix";
#page {
nav ul.navi, .article{
@extend %clearfix;
}
}
@xx4159
xx4159 / mosql-wiki.md
Created November 28, 2016 06:15
Migrate Mongodb to PostgreSQL

Migrate Mongodb to PostgreSQL

목적

  • 사용자의 로컬 테스트를 목적으로 쓰여진 내용입니다.
  • mac osx에서 진행했으며, ubuntu 나 centos같은 다른 리눅스 버전에서는 다를 수 있음!
  • This is FOR OSX
  • I hope we collaborate.

Prerequire

  • postgreSQL install.
  • mongodb가 replica setting.

Semver

  • Semantic Versioning
  • [Major].[Minor].[Patch]
    • major: incompatible change
    • minor: add functionality, backwards-compatible
    • patch: bug fixes. backwards-compatible

tilde

  • ~
Atom sync-settings
@xx4159
xx4159 / uri.js
Created May 2, 2019 08:23 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@xx4159
xx4159 / replace-curly.pipe.ts
Last active July 3, 2019 03:04
Replace curly braces to span
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'replaceCurly'
})
export class ReplaceCurlyPipe implements PipeTransform {
transform(value: string): string {
const regex = /\{\{([^\{].*?)\}\}/g;
if (value) {
return value.replace(regex, `<span>$1</span>`);
import { Injectable } from '@angular/core';
import 'intersection-observer';
declare global {
interface Window {
IntersectionObserver: IntersectionObserver;
}
}
const defaults = {
@xx4159
xx4159 / version.sh
Created January 10, 2020 02:55 — forked from DarrenN/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
🌞 Morning 13 commits █▋░░░░░░░░░░░░░░░░░░░ 7.9%
🌆 Daytime 65 commits ████████▎░░░░░░░░░░░░ 39.6%
🌃 Evening 56 commits ███████▏░░░░░░░░░░░░░ 34.1%
🌙 Night 30 commits ███▊░░░░░░░░░░░░░░░░░ 18.3%