This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define VOMIT_ON_FAILURE(a) do { if (0 != (a)) { VOMIT_ABORT(errno, #a); } } while (0) | |
#define VOMIT_ON_FAILURE_NO_ERRNO(a) do { int err = (a); if (0 != err) { VOMIT_ABORT(err, #a); } } while (0) | |
#define VOMIT_ABORT(err, str) do { int code = (err); fprintf(stderr, "%s failed on line %d in file %s: %d (%s)\n", str, __LINE__, __FILE__, code, strerror(code)); abort(); } while(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "rth.h" | |
#ifdef _RTF_TEST | |
cmnRTFInfo gTestCaseMap[MAX_RTF_HASH]; | |
static int cmnRTFGetHashVal ( const char* aTestString , int aStrLen ) | |
{ | |
int i; | |
unsigned int sKey = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use variable name as another variable's name | |
foobar="xx" | |
name=foobar | |
echo ${!name} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// webserver 모듈은 public 아래의 contents 를 기준으로 | |
// gulp 기동과 동시에 webserver 및 explorer 까지 띄워준다. | |
// gulp-livereload 모듈은 sublime-text 의 LiveReload | |
// 플러그인을 Enable 시키는데 이 때 400 ms 의 delay 를 주면서 | |
// chrome 의 live reload extension 과 통신하여 refresh 하게 한다. | |
var gulp = require('gulp'), | |
// jshint = require('gulp-jshint'), | |
sass = require('gulp-ruby-sass'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var gulp = require( 'gulp' ), | |
gutil = require( 'gulp-util' ), | |
fork = require( 'child_process' ).fork, | |
tinyLr = require( 'tiny-lr' ), | |
sass = require( 'gulp-ruby-sass' ), | |
sourcemaps = require('gulp-sourcemaps'), | |
async = require( 'async' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$roundness: 20px 0 20px 0; | |
@mixin clearfix { | |
&:before, | |
&:after { | |
content: ''; | |
display: table; | |
} | |
&:after { | |
clear: both; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// prints text and waits one second | |
function doSomethingAsync(callback) { | |
console.log('doSomethingAsync: Wait for one second.'); | |
setTimeout(function() { callback(); }, 1000); | |
} | |
// prints text and waits half a second | |
function doSomethingElseAsync(callback) { | |
console.log('doSomethingElseAsync: Wait for half a sec.'); | |
setTimeout(function() { callback(); }, 500); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'), | |
util = require('util'), | |
imgsize = require('image-size'); | |
module.exports = (function(){ | |
var supportExt = ["jpg", "jpeg", "png"]; // supported extension array | |
var dirPath = ""; // directory path | |
var fileList = []; // file name array | |
var fileInfo = [{}]; // array of file info object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'), | |
Schema = require('mongoose').Schema; | |
module.exports = (function() { | |
var defaultUrl = "mongodb://localhost:27017/test"; | |
var url = defaultUrl; | |
var schemaName = null; | |
var schemaDef = null; | |
var docuModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fileName = fPath.match(/[-_\w]+[.][\w]+$/i)[0]; | |
var fileName = fPath.split('/').pop(); |
OlderNewer