Skip to content

Instantly share code, notes, and snippets.

@upsilon
upsilon / gist:7261894
Created November 1, 2013 07:15
OpenPNE_KtaiEmoji::relation_list を json 形式にして出力する何か
<?php
$vendorPath = './lib/vendor';
set_include_path(get_include_path().PATH_SEPARATOR.$vendorPath);
require_once $vendorPath.'/OpenPNE2/KtaiEmoji.php';
$emoji = new OpenPNE_KtaiEmoji();
$relation_list = $emoji->relation_list;
// Docomo絵文字への変換分だけ出力
@upsilon
upsilon / gist:6896385
Last active July 12, 2017 09:44
Doctrine_Record::free(true) を実行すると同一レコードを指す別のインスタンスまで解放されてしまう
<?php
include_once dirname(__FILE__) . '/../../bootstrap/unit.php';
include_once dirname(__FILE__) . '/../../bootstrap/database.php';
$t = new lime_test(3, new lime_output_color());
$community1 = Doctrine_Core::getTable('Community')->find(1);
$t->is($community1->id, '1');
@upsilon
upsilon / gist:5308488
Created April 4, 2013 07:22
4/4 情報システム課への問い合わせ結果
it-chiba.ac.jp のドメインについて
==============================
順次廃止予定。情報システム課としては対処できない問題。
既存のメールアドレスについても廃止される予定。まだ利用は可能。
学内からの IMAP アクセスについて
============================
現象は確認しており、改善を行うつもり。
@upsilon
upsilon / SettingTabs.xml
Last active December 14, 2015 14:19
SettingTabs.xml の抜粋 (タイムラインの掃除に使ってゐる部分)
<?xml version="1.0"?>
<SettingTabs xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Tabs>
<TabClass>
<TabName>ngword</TabName>
<TabType>UserDefined</TabType>
<UnreadManage>false</UnreadManage>
<Locked>true</Locked>
<Notify>false</Notify>
<FilterArray>
@upsilon
upsilon / ClosureTest.cs
Created February 9, 2013 14:07
usingブロックの中でクロージャー
using System;
using System.Windows.Forms;
using NUnit.Framework;
class ClosureTest
{
[Test]
public void ClosureWithinUsingTest()
{
Func<bool> closure;
@upsilon
upsilon / gist:4647977
Created January 27, 2013 11:40
PostGISとOsmosisセットアップめも
wget http://bretth.dev.openstreetmap.org/osmosis-build/osmosis-latest.zip
unzip osmosis-latest.zip
chmod +x osmosis-0.41/bin/osmosis
sudo -u postgres
createuser osm
createdb osm
psql -U osm -c 'CREATE EXTENSION hstore'
psql -U osm < /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
psql -U osm < /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
psql -U osm < ./osmosis-0.41/script/pgsnapshot_schema_0.6.sql
@upsilon
upsilon / gist:4001734
Created November 2, 2012 14:36
japan.osm.bz2の展開後サイズは何GBになるか?
upsilon(xterm-256color)@upsilo.net:~$ wget -O - http://download.geofabrik.de/openstreetmap/asia/japan.osm.bz2 | bunzip2 - | wc -c
--2012-11-02 23:33:13-- http://download.geofabrik.de/openstreetmap/asia/japan.osm.bz2
Resolving download.geofabrik.de (download.geofabrik.de)... 46.4.99.10, 176.9.53.72
Connecting to download.geofabrik.de (download.geofabrik.de)|46.4.99.10|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1124411982 (1.0G) [application/x-bzip2]
Saving to: ‘STDOUT’
100%[==============================================>] 1,124,411,982 1.36MB/s in 13m 29s
@upsilon
upsilon / ksj2osm-admin.pl
Created September 16, 2012 23:05
国土数値情報(行政区域データ) OpenStreetMapインポート用スクリプト
#!/usr/bin/perl
#
# ksj2osm-admin.pl
#
# Modified by upsilon <kim.upsilon@bucyou.net>
#
# Original Author: Tatata (http://wiki.openstreetmap.org/wiki/User:Tatata)
#
# This source based on http://wiki.openstreetmap.org/wiki/User:Tatata/ksj2osm-admin.pl
@upsilon
upsilon / test_empty_value.php
Created August 16, 2012 11:20
PHPでGETパラメータとかの空値チェックしたいんだけど何これ
<?php
require_once '/path/to/lime.php';
function test_empty_values($lime, $validator)
{
/* これは空値と見なしたい */
$lime->ok($validator(null), "null");
$lime->ok($validator(''), "''");
$lime->ok($validator(' '), "' '");
@upsilon
upsilon / gist:3337529
Created August 13, 2012 06:53
CREATE TABLEをトランザクション内で実行した比較 (SQLite, MySQL)
upsilon(screen)@udon-dev:~/$ sqlite3 hoge.sqlite
SQLite version 3.7.13 2012-06-11 02:05:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> begin immediate;
sqlite> create table hoge (id integer, name string, value integer);
sqlite> .schema hoge
CREATE TABLE hoge (id integer, name string, value integer);
sqlite> rollback;
sqlite> .schema hoge