Skip to content

Instantly share code, notes, and snippets.

View co3k's full-sized avatar
🔞
"><s>'\

Kousuke Ebihara co3k

🔞
"><s>'\
View GitHub Profile
@co3k
co3k / gist:1099076
Created July 22, 2011 08:17
チケットに含まれるハッシュ値のうち、 stable-3.6.x に含まれるもののみを抽出するワンライナー
curl "https://raw.github.com/gist/1044456/dbe6d1d76e18d90c26c0352f6f8f51d9f68d5d4a/list-commit-hash-from-ticket.php" | sed 's/show\/165/show\/190/' | php | awk '{print "git branch --contains="$1"\|grep -q stable-3.6.x && echo "$1}' | sh
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/mysql/5.5.14 -DMYSQL_DATADIR=/usr/local/var/mysql -DINSTALL_MANDIR=/usr/local/Cellar/mysql/5.5.14/share/man -DINSTALL_DOCDIR=/usr/local/Cellar/mysql/5.5.14/share/doc/mysql -DINSTALL_INFODIR=/usr/local/Cellar/mysql/5.5.14/share/info -DINSTALL_MYSQLSHAREDIR=share/mysql -DWITH_SSL=yes -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DSYSCONFDIR=/usr/local/etc -DWITH_UNIT_TESTS=OFF -DWITH_READLINE=yes -DCMAKE_BUILD_TYPE=Debug
make
make install
@co3k
co3k / generate-bundled-op3-list.php
Created September 5, 2011 11:04
バンドルプラグインリストのデータを読み込み、 OpenPNE の各メジャーバージョンの最新のマイナーバージョンにどのプラグインのどのバージョンがバンドルされているかをリストするやつ
<?php
// To run, you need the Symfony\Yaml and Symfony\ClassLoader.
// You can get these libraries from PEAR installer by the followings:
// $ pear channel-discover pear.symfony.com
// $ pear install symfony2/Yaml
require_once 'Symfony/Component/Yaml/Yaml.php';
require_once 'Symfony/Component/Yaml/Parser.php';
require_once 'Symfony/Component/Yaml/Inline.php';
<html><head><title>a</title></head><body>
<?php
for ($i = 200; $i < 300; $i++) {
setcookie('example'.$i, $i.' '.date('Y-m-d H:i:s'));
var_dump('set '.$i);
}
var_dump(count($_COOKIE), $_COOKIE);
diff --git a/data/migrations/3.3.1/034_add_is_pre_column.php b/data/migrations/3.3.1/034_add_is_pre_column.php
index 88b8c35..a50ab42 100644
--- a/data/migrations/3.3.1/034_add_is_pre_column.php
+++ b/data/migrations/3.3.1/034_add_is_pre_column.php
@@ -15,7 +15,7 @@ class Revision34_AddIsPreColumn extends Doctrine_Migration_Base
$this->column($direction, 'community_member', 'is_pre', 'boolean', null, array(
'default' => 0,
'notnull' => true,
- 'comment' => 'Member\\\'s position in this community',
+ 'comment' => 'Member\'\'s position in this community',
{{Template:OWASP Testing Guide v3}}
==The OWASP Risk Rating Methodology==
Discovering vulnerabilities is important, but just as important is being able to estimate the associated risk to the business. Early in the lifecycle, you may identify security concerns in the architecture or design by using [[threat modeling]]. Later, you may find security issues using [[code review]] or [[penetration testing]]. Or you may not discover a problem until the application is in production and is actually compromised.
By following the approach here, you'll be able to estimate the severity of all of these risks to your business, and make an informed decision about what to do about them. Having a system in place for rating risks will save time and eliminate arguing about priorities. This system will help to ensure that you don't get distracted by minor risks while ignoring more serious risks that are less well understood.
Ideally, there would be a universal risk rating system that would accurately estimate all risks fo
@co3k
co3k / 1MB 減らせるやつ
Created October 24, 2011 11:35
op3 performance
diff --git a/lib/model/doctrine/SnsConfig.class.php b/lib/model/doctrine/SnsConfig.class.php
index 49a8163..dfe5f64 100644
--- a/lib/model/doctrine/SnsConfig.class.php
+++ b/lib/model/doctrine/SnsConfig.class.php
@@ -10,20 +10,23 @@
class SnsConfig extends BaseSnsConfig
{
- protected $snsConfigSettings = array();
+ protected static $snsConfigSettings = array();
diff --git a/config/config.php b/config/config.php
index 96ce605..399483e 100644
--- a/config/config.php
+++ b/config/config.php
@@ -1,2 +1,2 @@
<?php
-$this->dispatcher->connect('routing.load_configuration', array('opAlbumPluginRouting', 'listenToRoutingLoadConfigurationEvent'));
+//$this->dispatcher->connect('routing.load_configuration', array('opAlbumPluginRouting', 'listenToRoutingLoadConfigurationEvent'));
diff --git a/config/routing.yml b/config/routing.yml
new file mode 100644
diff --git a/config/config.php b/config/config.php
index 3c89123..6285a1d 100644
--- a/config/config.php
+++ b/config/config.php
@@ -1,5 +1,5 @@
<?php
-$this->dispatcher->connect('routing.load_configuration', array('opMessagePluginRouting', 'listenToRoutingLoadConfigurationEvent'));
+// $this->dispatcher->connect('routing.load_configuration', array('opMessagePluginRouting', 'listenToRoutingLoadConfigurationEvent'));
$this->dispatcher->connect('op_action.post_execute_friend_link', array('opMessagePluginObserver', 'listenToPostActionEventSendFriendLinkRequestMessage'));