Skip to content

Instantly share code, notes, and snippets.

View jeonghwan-kim's full-sized avatar

김정환 jeonghwan-kim

View GitHub Profile
@jeonghwan-kim
jeonghwan-kim / is_installed.sh
Created February 16, 2017 02:09 — forked from JamieMason/is_installed.sh
Check if a program exists from a bash script. Thanks to twitter.com/joshnesbitt and twitter.com/mheap for the help with detecting npm packages.
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
@jeonghwan-kim
jeonghwan-kim / _service.md
Created June 20, 2016 02:19 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var mocha = require('gulp-mocha');
@jeonghwan-kim
jeonghwan-kim / gist:82e9e10078d319d82947
Last active September 7, 2015 11:32 — forked from wacko/gist:5577187
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 2 > host-only vboxnet0

<!doctype html>
<html ng-app="Demo" ng-controller="AppController">
<head>
<meta charset="utf-8" />
<title>
Lazy Loading Images With AngularJS
</title>
<style type="text/css">
app.filter('parseUrl', function() {
var //URLs starting with http://, https://, or ftp://
replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,
//URLs starting with "www." (without // before it, or it'd re-link the ones done above).
replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim,
//Change email addresses to mailto:: links.
replacePattern3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim;
return function(text, target, otherProp) {
angular.forEach(text.match(replacePattern1), function(url) {
<ul class="post-it">
<li><a href="#">SUNDAY</a></li>
<li><a href="#">MONDAY</a></li>
<li><a href="#">TUESDAY</a></li>
<li><a href="#">WENDSDAY</a></li>
<li><a href="#">THURSDAY</a></li>
<li class="active"><a href="#">FRIDAY</a></li>
<li><a href="#">SATERDAY</a></li>
</ul>
<div class="note">HERE IS NOTE.</div>http://codepen.io/JeonghwanKim/pen/IhsdC#