$ sudo npm install -g hexo-cli
$ hexo -v
hexo-cli: 0.1.9
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
This file contains hidden or 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
function powerset (input) { | |
return input | |
.split(input ? '' : false) | |
.filter(duplicates({})) | |
.map(concatEmptyStr) | |
.reduce(multiplyMatrix) | |
} | |
function concatEmptyStr (str) { | |
return str ? ['', str] : [''] |
This file contains hidden or 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
SELECT * FROM my_table | |
INTO OUTFILE 'my_table.csv' | |
CHARACTER SET euckr | |
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' | |
ESCAPED BY '\\' | |
LINES TERMINATED BY '\n' |