$ sudo npm install -g hexo-cli
$ hexo -v
hexo-cli: 0.1.9
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
# Copy and self modified from ys.zsh-theme, the one of default themes in master repository | |
# Clean, simple, compatible and meaningful. | |
# Tested on Linux, Unix and Windows under ANSI colors. | |
# It is recommended to use with a dark background and the font Inconsolata. | |
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white. | |
# http://xiaofan.at | |
# 2 Jul 2015 - Xiaofan | |
# Machine name. | |
function box_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
### define function variable before block to avoid code being appended to closing part of JSDoc comment ### | |
cube = '' | |
###* | |
* Funtion to calculate cube of input | |
* @param {number} Number to operate on | |
* @return {number} Cube of input | |
### | |
cube = (x) -> x*x*x |
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
import asyncio | |
import base64 | |
import enum | |
import secrets | |
from pprint import pprint | |
import graphene | |
from graphql.execution.executors.asyncio import AsyncioExecutor | |
Here's an example of how to embed a Gist on GitHub Pages:
{% gist 5555251 %}
All you need to do is copy and paste the Gist's ID from the URL (here 5555251
), and add it to a gist
tag surrounded by {%
and %}
.
This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.
# Ensure system is in ship-shape.
aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev
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 mergeSort = function(array) { | |
if (array.length === 1) { | |
return array | |
} else { | |
var split = Math.floor(array.length/2) | |
var left = array.slice(0, split) | |
var right = array.slice(split) | |
left = mergeSort(left) | |
right = mergeSort(right) |
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
// 컬렉션 중심 프로그래밍의 4가지 유형과 함수 | |
// 1. 수집하기 - map > values, pluck 등 | |
// 2. 거르기 - filter > reject, compact, without 등 | |
// 3. 찾아내기 - find > some, every 등 | |
// 4. 접기 - reduce > min, max, group_by, count_by | |
########### | |
function _is_object(obj) { | |
return typeof obj == 'object' && !!obj; | |
} |
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
<html><head></head><body> | |
<section id="todo"></section> | |
<script> | |
const TaskState = class { | |
static addState(key, cls) { | |
const v = new cls(); | |
if (!(v instanceof TaskState)) throw 'invalid cls'; | |
if ((TaskState._subClasses || (TaskState._subClasses = new Map())).has(key)) throw 'exist key'; | |
TaskState._subClasses.set(key, cls); | |
} |
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
/* Calculates the power set, P(s) := { s' : s' is a subset of s } | |
* Assumes an implementation of a Set that has the following methods: | |
* add, equals, forEach, clone | |
*/ | |
var powerSet = function(set) { | |
var prevSet = new Set(); // prevSet := {} | |
var currSet = new Set().add(new Set()); // currSet := { {} } | |
// Main loop will continually add elements to currSet until no | |
// new elements are added |