Skip to content

Instantly share code, notes, and snippets.

kijtra kijtra

Block or report user

Report or block kijtra

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kijtra
kijtra / Reg.php
Last active Jan 14, 2016
#PHP preg_match Wrapper
View Reg.php
<?php
class Reg
{
private $source = null;
private $matched = false;
public function __construct($source)
{
$this->source = $source;
}
@kijtra
kijtra / Data.class.php
Last active Oct 28, 2015
[PHP] Access multi-dimensional array using dot separated string. e.g) $obj->get('key1.key2.key3');
View Data.class.php
<?php
/*
* inspired Slim\Helper\Set
* https://github.com/slimphp/Slim/blob/2.x/Slim/Helper/Set.php
*/
class Data implements \ArrayAccess, \Countable, \IteratorAggregate
{
private $data = array();
private $buffer = array();
@kijtra
kijtra / helper-extends.css
Last active Aug 29, 2015
#CSS Bootstrap Helper Extends
View helper-extends.css
.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-
@kijtra
kijtra / toolbar.cson
Last active Aug 29, 2015
My Atom flex-tool-bar setting (2015-06) ※JSONからCSONに変更
View toolbar.cson
[
# project-managerプラグインの起動
{
type: "button"
icon: "repo"
callback: "project-manager:toggle"
tooltip: "Open Project"
style: {
color: "cyan"
}
@kijtra
kijtra / meconv.php
Created May 19, 2015
simple convert integer(system max numeric) <-> string(always 14 chars)
View meconv.php
<?php
function meconv($value)
{
if (ctype_digit(strval($value))) {
$str = chr(96 + strlen(base_convert($value, 10, 36)));
$str .= base_convert($value, 10, 36);
$str .= md5($value);
return substr($str, 0, 14);
} elseif(is_string($value)) {
@kijtra
kijtra / geohash.js
Last active Aug 29, 2015
[JavaScript] Encode or decode GeoHash
View geohash.js
function geohash(lat, lon, len)
{
if (len) {
len = Number(len);
if (len < 1 || len > 12) {
return false;
}
} else {
len = 12;
}
@kijtra
kijtra / geohash.php
Created May 14, 2015
[PHP] Geo Hash encode and decode function.
View geohash.php
<?php
function geohash($lat, $lon = NULL, $len = 12)
{
if ($len < 1 || $len > 12) {
return false;
}
$base32Chars = array(
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'b', 'c', 'd', 'e', 'f', 'g',
@kijtra
kijtra / twitter.gs
Last active Jun 9, 2019
Google Apps Script での 「oAuthConfig」のサポート終了後用の Twitter API スクリプト。「OAuth1」ライブラリ(ID:Mb2Vpd5nfD3Pz-_a-39Q4VfxhMjh3Sh48)が必要。
View twitter.gs
// 最初にこの関数を実行し、ログに出力されたURLにアクセスしてOAuth認証する
function twitterAuthorizeUrl() {
Twitter.oauth.showUrl();
}
// OAuth認証成功後のコールバック関数
function twitterAuthorizeCallback(request) {
return Twitter.oauth.callback(request);
}
@kijtra
kijtra / vars.php
Last active Aug 29, 2015
#PHP 変数のSet/Get用関数
View vars.php
<?php
function vars($keys = null, $value = null)
{
static $values = array(), $buffer = array();
if (empty($keys)) {
return $values;
}
@kijtra
kijtra / gooapi.php
Created Dec 4, 2014
[PHP] gooラボ( https://labs.goo.ne.jp/ )の文字列解析系API用のクラス(やっつけ)
View gooapi.php
<?php
/*
本番利用にはクレジット表記が必要なので注意
https://labs.goo.ne.jp/apiusage/
*/
class gooAPI
{
private $app_id = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx';
private $api_base = 'https://labs.goo.ne.jp/api/';
You can’t perform that action at this time.