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> | |
<div style="width: 100px"> | |
<img src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 24 24"><text x="0" y="12" font-size="12">你好</text></svg>' style="width: 50%" /> | |
</div> | |
</html> |
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
/* | |
* HHKB Layout | |
*/ | |
// Remember to uncomment `KEYMAP_SECTION_ENABLE = yes` in Makefile | |
#include "keymap_common.h" | |
#ifdef KEYMAP_SECTION_ENABLE | |
const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = { | |
#else |
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
(def RATE_LIMIT 5) | |
(defn operate [n] | |
(println "test-operate" n (.now js/Date)) | |
(async/timeout 1000)) | |
(defn -test [] | |
(let [limit-chan (async/chan (- RATE_LIMIT 1))] | |
(go (doseq [n (range 20)] | |
(let [operate-chan (operate n)] |
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 groups = $('#data-table > tbody').map((index, elem) => ({ | |
title: $(elem).find('.group-title').text(), | |
entries: $(elem).find('.reports-table-children > tbody > tr').map((index, elem) => ({ | |
title: $.trim($(elem).find('.col-title').text()), | |
time: parseFloat($.trim($(elem).find('.col-total').text()), 10) | |
})).toArray() | |
})).toArray() | |
groups.forEach(group => { | |
const groupedEntries = group.entries.reduce((memo, entry) => { | |
memo[entry.time > 1 ? 'isolate' : 'merge'].push(entry) |
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/env bash | |
# GistID: 9499613 | |
# Example Makefile: | |
# npm : | |
# @echo "Check npm package update..." | |
# @CHECK_FILE=package.json STATE_FOLDER=node_modules bash scripts/update_manager.sh check; \ | |
# if [ $$? -eq 1 ]; then \ | |
# npm install \ | |
# && npm update \ |
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 co from 'co' // or whatever like co | |
import fetch from './fetch_data_synchronously' | |
import fetchAsync from './fetch_data_asynchronously' | |
export function process() { | |
const generator = processAlgorithmGenerator(fetch) | |
let next = { done: false } | |
while(!next.done) { | |
next = generator.next(next.value) | |
} |
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 R from 'ramda' | |
class CR { | |
constructor(fn) { | |
this.runCR = (fn || R.identity) | |
} | |
} | |
R.keys(R).forEach(method => { | |
CR.prototype[method] = function() { | |
var rfn = arguments.length ? R[method].apply(null, arguments) : R[method] |
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
test |
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 UIKit | |
// Color from: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/ColorImagesText.html | |
class GuideColor { | |
static let cyan = UIColor(red: 90/255, green: 200/255, blue: 250/255, alpha: 1) | |
static let yellow = UIColor(red: 255/255, green: 204/255, blue: 0/255, alpha: 1) | |
static let orange = UIColor(red: 255/255, green: 149/255, blue: 0/255, alpha: 1) | |
static let pink = UIColor(red: 255/255, green: 45/255, blue: 85/255, alpha: 1) | |
static let blue = UIColor(red: 0, green: 122/255, blue: 255/255, alpha: 1) | |
static let green = UIColor(red: 76/255, green: 217/255, blue: 100/255, alpha: 1) |
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
# -*- coding: utf-8 -*- | |
description 'exec git push after save page' | |
Page.hook :after_commit do | |
Olelo.logger.info "push git history after save page" | |
git_path = Config[:repository][:git][:path] | |
response = `git --git-dir=#{git_path} --bare push origin master 2>&1` | |
if $?.success? | |
Olelo.logger.info "git history push success" | |
else |