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
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" => { |
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
#!/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 |
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
// 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> |
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
(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) { |