Skip to content

Instantly share code, notes, and snippets.

<?php
$str[] = ':jamie_h!~textual@72.32.115.231 PRIVMSG #test_channel :test message';
$str[] = ':jamie_h!~textual@72.32.115.231 PRIVMSG #test_channel :fii message';
$str[] = ':jamie_h!~textual@72.32.115.231 PRIVMSG #test_channel :foo message';
$str[] = ':jamie_h!~textual@72.32.115.231 PRIVMSG #test_channel :message test boo';
$str[] = ':jamie_h!~textual@72.32.115.231 PRIVMSG #test_channel :blaat fii message';
foreach($str as $s) {
preg_match('/:([^!]+)[^:]+:(.*(test|fii).*)/', $s, $matches);
@rianorie
rianorie / gist:9762640
Created March 25, 2014 14:10
keybase.md
### Keybase proof
I hereby claim:
* I am rianorie on github.
* I am rianorie (https://keybase.io/rianorie) on keybase.
* I have a public key whose fingerprint is FEA7 7567 EAF8 F36E 80FF B936 DE26 8EB7 E328 E148
To claim this, I am signing this object:
@rianorie
rianorie / gist:10128823
Last active August 29, 2015 13:58
mudlet example
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.0">
<TriggerPackage>
<TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>demo</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
@rianorie
rianorie / gist:cb554b8b1641c7908af2
Created July 10, 2014 22:48
skilleo Squad Formation Curse
<?php
$n = 6;
$k = 3;
$squads = 0;
$pattern = 'R??L?R';
$curse = '';
for($i = 0; $i < $k; $i++) { $curse .= 'R'; }
@rianorie
rianorie / Magento cache wtf.php
Created July 15, 2014 14:33
Magento cache wtf
<?php
include(__DIR__.'/../app/Mage.php');
Mage::app();
$s = microtime(true);
var_dump( Mage::getStoreConfig('test/test/test') );
<?xml version="1.0" encoding="UTF-8"?>
<config>
<sections>
<payment>
<groups>
<foggyline_stripe translate="label" module="pay">
<label>Foggyline Stripe</label>
<tab>Sales</tab>
<frontend_type>text</frontend_type>
$options[] = array(
'title' => 'Extra informatie',
'comment' => '',
'type' => 'area',
'is_require' => 0,
'sort_order' => 8,
'is_delete' => '',
'previous_type' => '',
'previous_group' => '',
'price' => '0.00',
<?php
set_time_limit(5);
ini_set('max_execution_time', 5);
function shutdown()
{
// This is our shutdown function, in
// here we can do any last operations
// before the script is complete.
<?php
$data = strtolower(trim($data));
if ( ! strlen($data)) { // ""
$r = '';
} elseif (is_numeric($data) || is_bool($data)) { // "0" "1" 0 1 false true
$r = ((bool)intval($data) ? 'Yes' : 'No');
@rianorie
rianorie / gist:7f9bf5c92d2559cf2bff
Created November 3, 2014 16:03
Phalcon PHP getPartial
<?php // file [project]/Library/View.php
namespace YourNamespace\Library;
class extendedView extends \Phalcon\Mvc\View
{
public function getPartial($path, $params = array())
{
ob_start();
$this->partial($path, $params);
return ob_get_clean();