Skip to content

Instantly share code, notes, and snippets.

View highruned's full-sized avatar
💭
Forging...

HighRuned highruned

💭
Forging...
View GitHub Profile
Brain1:/repo/app-brain# wget -d http://brain/
DEBUG output created by Wget 1.11.4 on linux-gnu.
--2011-03-20 01:04:07-- http://brain/
Resolving brain... 127.0.0.1
Caching brain => 127.0.0.1
Connecting to brain|127.0.0.1|:80... connected.
Created socket 3.
Releasing 0x0000000001809880 (new refcount 1).
server {
listen 80; ## listen for ipv4
server_name brain brain.us.to;
access_log /var/log/nginx/localhost.access.log;
location / {
root /repo/app-brain/www;
index index.php;
}
location ~ \.php$ {
/**
* @ManyToMany(targetEntity="Keyword", mappedBy="blogs", cascade={"all"}, fetch="EXTRA_LAZY")
*/
protected $keywords;
params = []
i = 0
l = arguments.length
while i < l
params[i] = core.trait(arguments[i])
++i
@highruned
highruned / gist:1025783
Created June 14, 2011 20:27
Top Sellers
<?
$list_a = array();
$list_b = array();
foreach($products as $i => $product) {
$column = ($i % 2) + 1;
if($column === 1) $a[] = $product;
else if($column === 2) $b[] = $product;
}
<li>
<div id="related_vehicle_list" class="clear">
<? $this->viewPath = PATH_APP.'/modules/auto/controllers/auto_vehicles'; $this->renderPartial('related_vehicle_list'); ?>
</div>
<p class="addDocument img_noBottomPading"><a href="#" onclick="new PopupForm('onCustomEvent', {ajaxFields: get_ajax_fields() }); return false;">Add vehicle(s)</a></p>
<input type="hidden" name="related_vehicle_id" id="related_vehicle_id" value=""/>
<input type="hidden" name="add_related_vehicle_mode" value="1"/>
<script type="text/javascript">
MyClass::create_dummy_shipment(array(
'order' => $order
));
...
public static function create_dummy_shipment($params = array()) {
$params['order'] = Shop_Order::create()->order("rand() desc")->find();
extract(UnitTest_Helper::validate_parameters(array(
class URI {
public static function sanitize($url) {
if(!$url)
return;
$url = str_replace('www.', '', trim(strtolower($url)));
preg_match('#^([a-zA-Z0-9:/_.-]*).*$#m', $url, $m1);
$url = $m1[1];
@highruned
highruned / gist:1244305
Created September 27, 2011 03:57
php leak
<?php
class testclass {
protected $_r;
public function __construct() {
$this->getr();
@highruned
highruned / gist:1244320
Created September 27, 2011 04:05
trying to fix php leak
<?php
class testclass {
protected $_r;
public function __construct() {
$this->getr();