Skip to content

Instantly share code, notes, and snippets.

View jeonghwan-kim's full-sized avatar

김정환 jeonghwan-kim

View GitHub Profile
<ng-pluralize
count="remainingCount"
when="{ 0: 'No item', one: 'a item', other: '{} items' }">
</ng-pluralize>
@jeonghwan-kim
jeonghwan-kim / .jshinrc
Created November 11, 2015 10:59
.jshinrc sample
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
@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

var https = require('https');
var iconv = require('iconv-lite');
function (req, reply) {
// 인증결과 확인
if (req.payload.P_STATUS !== '00') {
// 에러 처리
}
@jeonghwan-kim
jeonghwan-kim / gist:a3932b62d74cbcb452e2
Created April 2, 2015 08:31
$anchorScroll example
'use strict';
angular.module('myApp')
.controller('FaqCtrl', function ($scope, $location, $anchorScroll) {
$scope.scrollTo = function(id) {
$location.hash(id);
$anchorScroll();
}
});
<!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) {
@jeonghwan-kim
jeonghwan-kim / angularjs-save-cookie.js
Created April 20, 2014 03:50
angularjs-save-cookie.js
@jeonghwan-kim
jeonghwan-kim / delete-aws-s3.js
Created March 17, 2014 11:08
delete object in S3
var aws = require('aws-sdk');
var BUCKET = 'node-sdk-sample-7271';
aws.config.loadFromPath(require('path').join(__dirname, './aws-config.json'));
var s3 = new aws.S3();
var params = {
Bucket: 'node-sdk-sample-7271',
Delete: { // required
Objects: [ // required
{
all: foo boo
foo:
mocha test_foo.js -R spec
boo:
mocha test_boo.js -R spec -t 5555