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
#!/usr/bin/python | |
# encoding: utf-8 | |
import sys | |
import os | |
from workflow import Workflow3, web | |
reload(sys) | |
sys.setdefaultencoding("utf-8") |
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
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
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
{%- extends 'basic.tpl' -%} | |
{%- block header -%} | |
<!DOCTYPE html> | |
<html> | |
<head> | |
{%- block html_head -%} | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no,target-densitydpi=medium-dpi,viewport-fit=cover"> | |
<meta name="format-detection" content="telephone=no,address=no,email=no"/> |
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
const path = require('path') | |
const webpack = require('webpack') | |
const ExtractTextPlugin = require('extract-text-webpack-plugin') | |
const HtmlWebpackPlugin = require('html-webpack-plugin') | |
const CopyWebpackPlugin = require('copy-webpack-plugin') | |
module.exports = { | |
// Entry files for our popup and background pages | |
entry: { | |
popup: './src/popup.js', |
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
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |
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 p = function () { | |
var d = Q.defer(); | |
d.reject(); | |
return d.promise; | |
}; | |
# Case 1 | |
p() | |
.then(function () { | |
console.log('A'); |
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
/** | |
* 데이터 타입을 미리 정의하고, 전달받은 데이터에서 타입에 맞는 값을 받아 설정한다. | |
* 타입 정의는 JSON 형태로 하며, 객체에 설정한 키값을 {{ }} 안에 dot으로 패스를 구분해 넣는다. | |
* { | |
* '전달받을 데이터의 키': '{{dot으로 구분한 키값}}', | |
* } | |
* | |
* @param {Object} context | |
* @param {Object} data | |
* @param {Object} typeDef |
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 str = '0x48 0x65 0x6c 0x6c 0x6f'; // Hello | |
hexstr2binstr(str); //--> '0100 1000 0110 0101 0110 1100 0110 1100 0110 1111' | |
function hexstr2binstr(hexstr) { | |
return hexstr.split(' ').map(function (v) { | |
var bins = Number(v).toString(2).split(''); | |
while (bins.length < 8) { | |
bins.unshift('0'); // left padding with '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
module.exports = function (grunt) { | |
// Code snippets for livereload | |
// https://github.com/gruntjs/grunt-contrib-livereload | |
var path = require('path'); | |
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet; | |
var folderMount = function folderMount(connect, point) { | |
return connect.static(path.resolve(point)); | |
}; |
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
module.exports = function (grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
concat: { | |
options: { | |
banner: '/*! <%= pkg.name %> - <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd") %>) */\n\n', | |
separator: '\n' | |
}, |
NewerOlder