Skip to content

Instantly share code, notes, and snippets.

View 10sr's full-sized avatar
👀
I may be slow to respond.

10sr 10sr

👀
I may be slow to respond.
View GitHub Profile
@10sr
10sr / stooge_loader.rb
Created July 21, 2018 04:42 — forked from bowsersenior/stooge_loader.rb
A demo of YAML anchors, references and nested values
require 'rubygems'
require 'yaml'
# A demonstration of YAML anchors, references and handling of nested values
# For more info, see:
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/
stooges = YAML::load( File.read('stooges.yml') )
# => {
# "default" => {
@10sr
10sr / AsciidocCheatsheet.adoc
Created June 6, 2016 03:15 — forked from powerman/AsciidocCheatsheet.adoc
Asciidoc cheatsheet for GitHub

Asciidoc cheatsheet for GitHub

#!/bin/bash
# prints a color table of 8bg * 8fg * 2 states (regular/bold)
echo
echo Table for 16-color terminal escape sequences.
echo Replace ESC with \\033 in bash.
echo
echo "Background | Foreground colors"
echo "---------------------------------------------------------------------"
for((bg=40;bg<=47;bg++)); do
@10sr
10sr / firefox-addon-manager.ks.js
Created March 5, 2012 05:56 — forked from 958/firefox-addon-manager.ks.js
[keysnail]Firefox addon manager (Add ext copyto-clipboard)
// Info
let PLUGIN_INFO =
<KeySnailPlugin>
<name>Firefox addon manager</name>
<description>Firefox addon manager</description>
<description lang="ja">Firefox のアドオン管理</description>
<updateURL>https://raw.github.com/gist/1011984/firefox-addon-manager.ks.js</updateURL>
<iconURL>https://sites.google.com/site/958site/Home/files/firefox-addon-manager.ks.png</iconURL>
<author>958</author>
@10sr
10sr / gt.ks.js
Created February 1, 2011 07:34 — forked from mooz/gt.ks.js
(function(){
let targetLang = "ja"; // target lang to translate into
let alternativeLang = "en"; // if given word is in targetLang, use this instead as a target lang
function translate(word, target, next) {
next("", "", " getting...");
const base = "https://www.googleapis.com/language/translate/v2?key=%s&q=%s&target=%s";
const apikey = "AIzaSyBq48p8NhFgaJ1DfUJ5ltbwLxeXpjEL86A";
let ep = util.format(base, apikey, encodeURIComponent(word), target);
util.httpGet(ep, false, function (res) {
if (res.status === 200) {