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 React from "react"; | |
import i18n from "path/to/i18n.js"; | |
const HelloWorld = () => { | |
return(<p>{ i18n.t("hello") }</p>); | |
} | |
export default HelloWorld; |
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
perl -e 'undef $/; $_ = <>; $p = (3 - (length)%3)%3; $_ = pack "u", $_; s/^.//mg; tr|` -_|AA-Za-z0-9+/|; s/A{$p}\n$/"="x$p."\n"/se; print' somefile |
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 -*- | |
// ==UserScript== | |
// @name They are all 17 years old | |
// @author HIRATA Yasuyuki <[email protected]> | |
// @namespace http://yasu.asuka.net/ | |
// @version 1.1.0 | |
// @include http://www.google.tld/search?* | |
// @include https://www.google.tld/search?* | |
// @released 2013-04-23 | |
// @updated 2013-04-30 |
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
// ==UserScript== | |
// @name Rakuten - Remove Ads | |
// @version 1.0 | |
// @namespace http://yasu.asuka.net/ | |
// @include http://search.rakuten.co.jp/* | |
// @description 楽天市場の検索画面に出る広告を削除する | |
// ==/UserScript== | |
(function() { | |
ads = document.getElementById("adsDisplayArea"); |
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
// bookmarklet | |
javascript:window.location='tweetbot:///post?text=Browsing%3A%20%22' | |
+encodeURIComponent(document.title)+'%22%20'+encodeURIComponent(encodeURI(window.location.href)); | |
// keyconfig | |
loadURI('tweetbot:///post?text=Browsing%3A%20%22' + encodeURIComponent(window._content.document.title)+'%22%20' + encodeURIComponent(window._content.location.href)); |
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 ruby | |
require "zlib" | |
fp = File.open(ARGV.shift, "r:binary") | |
Marshal.load(fp.read).each.with_index do |cont, index| | |
id, name, code = cont | |
code = Zlib::Inflate.inflate(code).force_encoding("utf-8") | |
puts "#"*79 if 0 < index | |
printf "[%s] (%d)\n%s", name, id, code |
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
% ruby ragnarok_items.rb > log.txt | |
ragnarok_items.rb:14:in `block in initialize': NotImplementedError: method `method_missing' called on terminated object (0x00000100d93018 flags=0x0 klass=0x0): SELECT "items".* FROM "items" WHERE (regex(name_iro, 'Battle Axe')) (ActiveRecord::StatementInvalid) | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/database.rb:321:in `call' | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/database.rb:321:in `block in create_function' | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/statement.rb:108:in `call' | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/statement.rb:108:in `step' | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/statement.rb:108:in `block in each' | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/statement.rb:107:in `loop' | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/statement.rb:107:in `each' | |
from /opt/loc |
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
% ruby ragnarok_items.rb > log.txt | |
ragnarok_items.rb:14:in `block in initialize': NotImplementedError: method `method_missing' called on terminated object (0x00000101cf7018 flags=0x0 klass=0x0): SELECT "items".* FROM "items" WHERE (regex(name_iro, 'Battle Axe')) (ActiveRecord::StatementInvalid) | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/database.rb:321:in `call' | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/database.rb:321:in `block in create_function' | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/statement.rb:108:in `call' | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/statement.rb:108:in `step' | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/statement.rb:108:in `block in each' | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/statement.rb:107:in `loop' | |
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/sqlite3-1.3.5/lib/sqlite3/statement.rb:107:in `each' | |
from /opt/loc |
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 -*- | |
require "uri" | |
require "open-uri" | |
require "nokogiri" | |
require "kconv" | |
class Fatechan::Plugin::GetURITitle | |
include Cinch::Plugin | |
listen_to :channel |
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
diff --git a/lib/cinch/utilities/encoding.rb b/lib/cinch/utilities/encoding.rb | |
index 2a248e2..a4d1bcb 100644 | |
--- a/lib/cinch/utilities/encoding.rb | |
+++ b/lib/cinch/utilities/encoding.rb | |
@@ -17,7 +17,7 @@ module Cinch | |
string.force_encoding("CP1252").encode!("UTF-8", {:invalid => :replace, :undef => :replace}) | |
end | |
else | |
- string.force_encoding(encoding).encode!({:invalid => :replace, :undef => :replace}) | |
+ string.force_encoding(encoding).encode!("UTF-8", {:invalid => :replace, :undef => :replace}) |