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
export default (rootElement, lang = 'ja') => { | |
const texts = [ | |
{ | |
before: new RegExp('Parallel translation', 'g'), | |
after: { ja: '対訳' } | |
}, | |
]; | |
const translate = node => { |
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
// For database connection. | |
var DSN = ''; | |
// WordPress database name. | |
var WPDB = ''; | |
// Salt constants in wp-config.php. | |
var LOGGED_IN_KEY = ''; | |
var LOGGED_IN_SALT = ''; | |
// siteurl option in wp_options table. | |
var SITEURL = 'http://example.com/'; |
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
# Title: Dot drawer | |
# Author: Ryo HAYASHI <ryo88c@gmail.com> | |
# | |
# Syntax: | |
# {% dot %} | |
# dotCode | |
# {% enddot %} | |
require 'open3' | |
require './plugins/raw' |
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 sublime, sublime_plugin | |
class ListingCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
list = [] | |
for x in range(0, self.view.window().num_groups()): | |
for file in self.view.window().views_in_group(x): | |
if file.file_name() == None: | |
continue | |
list.append('subl "%s"\n' % file.file_name()) |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<?php | |
class App_Exception_OAuth_InsufficientScope extends BEAR_Exception{ | |
protected $_defaultMessage = 'This request is insufficient scope.'; | |
protected $_default = array('code' => 'insufficient_scope'); | |
public function __construct($msg = null, array $config = array()){ | |
if(empty($msg)){ | |
$msg = $this->_defaultMessage; | |
} | |
$config = array_merge($this->_default, (array) $config); |
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
<?php | |
class App_Aspect_Lock implements BEAR_Aspect_Around_Interface{ | |
public function around(array $values, BEAR_Aspect_JoinPoint $joinPoint){ | |
$lock = sprintf('%s/tmp/locks/%s', _BEAR_APP_HOME, sha1(serialize($joinPoint->getMethodReflection()))); | |
if(!file_exists($lock)){ | |
touch($lock); | |
} | |
if(file_get_contents($lock)){ | |
return false; | |
} |
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
<?php | |
/** | |
* JSON出力 | |
* | |
* @param array $values 値 | |
* @param array $options オプション | |
* @return BEAR_Ro | |
* @author Ryo HAYASHI<ryo88c at gmail.com> | |
* @version 1.0.0 | |
* App/Resource/output/json.php |
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/local/bin/php -qn | |
<?php | |
/** | |
* Generated translation resources from the Smarty tags | |
* Tag: <!--t "STRING"--> | |
* | |
* @author Ryo HAYASHI <ryo88c at gmail.com> | |
*/ | |
class tpl2php{ |