Skip to content

Instantly share code, notes, and snippets.

View wonism's full-sized avatar
👨‍💻
undefined !== null

Jaewon wonism

👨‍💻
undefined !== null
View GitHub Profile
@wonism
wonism / Gist를 이용한 소스관리.markdown
Created May 2, 2016 04:35 — forked from safe1981/Gist를 이용한 소스관리.markdown
Article:Gist와 Sublime을 이용한 Code Snippet관리

#Gist를 이용한 코드조각관리 이번 글에서는 Code Snippet이라 불리는 코드조각을 효과적으로 어떻게 관리할 수 있을까에 대한 하나의 방법을 논하고자 한다. 개발을 진행하다보면 무수히 많은 코드를 작성하게 된다. 때때로 작성한 코드 중의 일부를 나중에도 활용해보기 위해 코드를 분류한다. 대체로 이런 경우 자신만의 메모장을 활용하거나, 자주 사용하는 에디터를 활용해서 이를 관리하는 경향이 있다. 하지만 이런 방법은 코드가 많아질수록 검색하기가 쉽지 않고, 개발언어에 따라 효율적으로 코드를 관리하기도 어렵다. 또한 개발하는 IDE환경에서도 손쉽게 사용할 수 없으며, 사무실/집 등, 여러 장소에서 동일하게 사용하는 것도 불가능하다. (물론 Dropbox)와 같은 클라우드 서비스를 활용하면 어느정도 다양한 환경에서 활용가능하지만 이 방법은 회사와 같이 보안 상의 이유로 서비스가 막혀 있는 곳에서는 제대로 적용이 불가능한 문제가 발생한다.

많은 웹사이트 조사를 통해 다양한 Snippet관리 서비스를 찾아봤지만, 그 중에서 개발에 가장 유용한 방식은 GitHub에서 제공하는 Gist라는 서비스를 이용하는 것이었다. 따라서 본 세션에서는 Gist를 이용한 Snippet관리 방식을 알아보고자 한다. 또한 최근 각광받고 있는 Sublime Text에서 Gist플러그인을 활용하여 어떻게 효율적으로 개발Editor와 함께 사용할 수 있는지도 알아보고자 한다.

#Gist환경 셋팅

Github 회원가입

Gist 사용을 위해서는 GitHub 회원가입을 한다. Github는 매우 유명하고 널리 퍼져있는 서비스이므로 서비스가 중단될 걱정을 하지 않고 사용할 수 있다. 외국사이트이니만큼 회원정보도 과도하게 요구하지 않는다.

Sublime에 Gist 플러그인 설치

var setCSS = function (el, p, v) {
var styles = window.getComputedStyle(document.documentElement, ''),
prefixes = ['webkit', 'Webkit', 'Moz', 'moz', 'Ms', 'ms', 'O',
'o', ''],
prefixLen = prefixes.length,
property = p[0].toUpperCase() + p.substring(1);
while (property.match(/\-/g)) {
property = property.split('-')[0] +
property.split('-')[1][0].toUpperCase() +
@wonism
wonism / simple-cache-busting-with-nginx.md
Created September 21, 2016 06:48 — forked from nepsilon/simple-cache-busting-with-nginx.md
Simple cache busting with Nginx — First published in fullweb.io issue #66

Simple cache busting with Nginx

You update your app.js or styles.css, but have a caching of 30 days and none of the clients will get the latest version? 😟

While the best would be to use a build mechanism to generate new filenames on the server, here is how to ensure clients get your last updates:

1. Change the name of the files in the HTML, for example styles.css to styles.123.css

2. Add this cache busting snippet in your nginx conf:

@wonism
wonism / HelloWorld.html
Last active January 3, 2017 16:32
Svelte example - 1
<!--
If you want to execute this example..
1. install svelte-cli via npm.
2. then, create HelloWorld.html (Recommend to name file name as PascalCase)
3. and, compile it! => command `svelte compile --format iife HelloWorld.html > HelloWorld.js`
4. If you did above 3 things, create index.html (https://gist.github.com/wonism/c5c11df61d0a6354fdc5f34ba184a835)
-->
<h1>Hello, {{name}}!</h1>
<button on:click="reverseName()">Click Me!</button>
@wonism
wonism / index.html
Created January 3, 2017 16:32
Svelte example - 2
<!DOCTYPE html>
<html>
<head>
<title>Svelte example</title>
</head>
<body>
<div id="svelte-app"></div>
<script src='./HelloWorld.js'></script>
<script>
const app = new HelloWorld({
@wonism
wonism / 001-Tradingview-Watchlist.md
Created January 9, 2018 04:04 — forked from cryppadotta/001-Tradingview-Watchlist.md
Tradingview Watchlist Import Files for Crypto Exchanges

Tradingview Watchlist Import Files for Crypto Exchanges

Below you'll find Tradingview import files for Bittrex and Binance BTC-base markets

Ordered by CMC's Market Cap

I use Tradingview and I like to quickly click through all coins on a particular exchange. The files below can be imported into a Tradingview watchlist.

★ ★ ★ If you use these, leave a comment or a star above ★ ★ ★

@wonism
wonism / .vimrc
Last active September 20, 2019 15:06
.vimrc
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'tpope/vim-fugitive'
Plugin 'isRuslan/vim-es6'
@wonism
wonism / cloudSettings
Last active November 5, 2019 04:50
vscode settings for vim user
{"lastUpload":"2019-11-05T04:50:43.737Z","extensionVersion":"v3.4.3"}
@wonism
wonism / .vimrc
Last active February 23, 2022 06:10
vimrc
""
"" Basic Setup
""
syntax enable
filetype off
set encoding=UTF-8
set nocompatible
set number
set ruler
set errorformat+=%f:\ line\ %l\\,\ col\ %c\\,\ %m,%-G%.%#
@wonism
wonism / pr.sh
Last active August 24, 2020 04:02
Command for opening a gh link to create a pull request from current working branch.
#!/bin/bash
function pr() {
url=$(git config --get remote.origin.url)
if [[ $url =~ "http" ]]; then
url=$(echo $url | sed -e "s/\.git//")
else
url=$(echo $url | sed -e "s/\:/\//" -e "s/git@/https:\/\//" -e "s/\.git//")
fi