Skip to content

Instantly share code, notes, and snippets.

Tom Van Looy tvlooy

Block or report user

Report or block tvlooy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tvlooy
tvlooy / magento_query.php
Created Jan 31, 2014
Magento query example
View magento_query.php
<?php
$db = Mage::getSingleton('core/resource')->getConnection('core_write');
$result = $db->query("SELECT * FROM cms_page");
while ($item = $result->fetch(PDO::FETCH_ASSOC)) {
print $item['title'] . ' | ';
}
View extra_config_yaml.php
<?php
/* Configure parameters and service in config.yml:
*
* imports:
* - { resource: parameters.extras.yml }
*
* services:
* dynamic.parameters:
* class: Ctors\MyBundle\Util\DynamicParameters
@tvlooy
tvlooy / ftps.php
Last active Aug 29, 2015
FTPS test script
View ftps.php
<?php
$ftp_server = 'ftps://servername/';
$ftp_user = 'user';
$ftp_password = 'pass';
$source_file = '/export/klanten.csv';
$destination_file = '/tmp/klanten.csv';
$file = fopen($destination_file, 'w');
@tvlooy
tvlooy / generateValueObject.sh
Last active Aug 29, 2015
Generate a Value Object
View generateValueObject.sh
#!/bin/bash
if [ ! -n "$1" ]; then
echo "Generate a Value Object"
echo "Usage: $0 src/Acme/DemoDomainBundle/Model/Something/Concept.php"
exit
fi
FILE=$1
@tvlooy
tvlooy / dmesg.txt
Last active Aug 29, 2015
Lenovo ideapad yoga 11s - OpenBSD dmesg
View dmesg.txt
OpenBSD 5.5-current (RAMDISK_CD) #102: Mon May 12 21:53:03 MDT 2014
todd@i386.openbsd.org:/usr/src/sys/arch/i386/compile/RAMDISK_CD
RTC BIOS diagnostic error 80<clock_battery>
cpu0: Intel(R) Core(TM) i5-4210Y CPU @ 1.5GHz ("GenuineIntel" 686-class) 1.40 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID
real mem = 2573516800 (2454MB)
avail mem = 2523840512 (2406MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 08/16/13, BIOS32 rev. 0 @ 0xef725, SMBIOS rev. 2.7 @ 0xe6ec0 (37 entries)
bios0: vendor LENOVO version "8FCN19WW(V1.00)" date 08/16/2013
@tvlooy
tvlooy / services.xml
Last active Aug 29, 2015
Example: inject repository into service
View services.xml
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="acme.demo.repository.class">Acme\DemoBundle\Entity\ExampleRepository</parameter>
<parameter key="acme.demo.service.class">Acme\DemoBundle\Service\ExampleService</parameter>
</parameters>
@tvlooy
tvlooy / gist:a6b9c58c5d1ab4076775
Created Jun 13, 2014
Example service with factory method
View gist:a6b9c58c5d1ab4076775
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="foo" class="DateTime"
factory-class="DateTime"
factory-method="createFromFormat">
<argument>Ymd</argument>
View gist:c8dcbe5c41d79dac63da
export GIT_PS1_SHOWDIRTYSTATE=1
PS1='[\[\033[00;31m\]\u@\h\[\033[00m\] \[\033[00;34m\]\w\[\033[00;31m\]$(__git_ps1)\[\033[00m\]]\n\$ '
View gist:0b935d0f633f7cbd7528
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_PAPER = "de_BE.UTF-8",
LC_ADDRESS = "de_BE.UTF-8",
LC_MONETARY = "de_BE.UTF-8",
LC_NUMERIC = "de_BE.UTF-8",
LC_TELEPHONE = "de_BE.UTF-8",
LC_IDENTIFICATION = "de_BE.UTF-8",
View xml128.py
#################################################################################
# CVE-XXXXX Wordpress and Drupal XML Blowup Attack DoS#
# Author: Nir Goldshlager - Salesforce.com Product Security Team#
# This is a Proof of Concept Exploit, Please use responsibly.#
#################################################################################
#!/usr/bin/env python
from __future__ import print_function
import threading
import time
import urllib
You can’t perform that action at this time.