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
#C++ 吧的吧友看过来 | |
头疼如何共享代码嘛?来使用 Github 的 Gist 吧…… | |
首先你需要一个 Github 的账号,不知道何为 Github 的现在就去搜索,这太可怕了。嗯嗯! | |
然后访问 gist dot github dot com,按照指示去做就可以了。方便吧…… | |
最后记着防度娘抽风哦! |
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
#include <iostream> | |
#include <ratio> | |
#include <chrono> | |
#include <string> | |
template <typename value_type> | |
struct timed { | |
std::chrono::time_point<std::chrono::steady_clock> timestamp; | |
value_type value; | |
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
class LRUElement { | |
constructor (data, master, index) { | |
this.data = data; | |
this.master = master; | |
this.index = index; | |
this.lastAccess = new Date(); | |
} | |
get value () { | |
return this.data; |
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 initWatchProperty (obj, key) { | |
if (obj['$$watchers$$' + key]) | |
return; | |
Object.defineProperty(obj, key, { | |
get: function () { | |
return this['$$' + key]; | |
}, | |
set: function (val) { | |
var old = this['$$' + key]; |
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 http = require('http'); | |
var server = http.createServer(onRequest); | |
function onRequest (req, res) { | |
res.writeHead(403, 'You are forbidden to visit this page due to Qujing\'s parental control.'); | |
res.write('You are forbidden to visit this page due to Qujing\'s parental control.'); | |
res.end(); | |
} |
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
<style> | |
ul, li { padding: 0; margin: 0; } | |
ul { width: 400px; } | |
li { | |
display: inline; | |
font-family: "Charis SIL"; | |
font-style: italic; | |
} |
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 fs = require('fs'); | |
function guardInit (init) { | |
var delayedCalls = []; | |
var status = 'not initialized'; | |
return function () { | |
if (status == 'initializing') | |
return delayedCalls.push(arguments); | |
if (status == 'initialized') |
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 lang="cmn-Hans-CN"> | |
<head> | |
<style type="text/css"> | |
#block { | |
width: 10em; | |
margin-left: 5em; | |
text-align: justify; | |
-webkit-hyphens: auto; | |
} | |
i { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
#picture-select { | |
display: block; | |
} | |
#canvas { |
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
{-# LANGUAGE DeriveDataTypeable, TemplateHaskell, TypeFamilies, FlexibleInstances, FlexibleContexts, InstanceSigs #-} | |
module Data.VCodePool where | |
import Data.Data (Data, Typeable) | |
import Data.SafeCopy (base, deriveSafeCopy, SafeCopy(..)) | |
import Control.Applicative ((<$>), (<*>)) | |
import Control.Monad.Reader (ask) | |
import Control.Monad.State (get, put) |
OlderNewer