Skip to content

Instantly share code, notes, and snippets.

@Avalarion
Avalarion / gist:3979140
Created October 30, 2012 09:03
[TYPO3][ExtBase] Query -> IN Example
<?php
/**
* Find all BadWords from the wordlist
*
* @param array[String] $wordList
* @return Tx_Extbase_Persistence_QueryResult
*/
public function findByBadWordList($wordList) {
$query = $this->createQuery();
$query->matching(
@Avalarion
Avalarion / gist:4242155
Created December 8, 2012 21:58
Simple Way to Read and Write RabbitMQ Messages without a framework
<?php
/**
* Using lib: https://github.com/videlalvaro/php-amqplib
* In Tag "v1.0"
*/
require_once(__DIR__.'/lib/php-amqplib/amqp.inc');
class TYPO3_RabbitMQ{
public static function writeMessage($host, $port, $user, $pass, $vhost, $channelID, $message, $restore = FALSE) {
@Avalarion
Avalarion / gist:4242481
Created December 8, 2012 23:19
Not Running Python RabbitMQ Basis
#!/usr/bin/env python
import pika
class rabbitmq_basis(object):
def __init__(self, host, port, user, password, vhost ):
self.host = host
self.port = port
self.user = user
self.password = password
self.vhost = vhost
private void loadGame() {
OpenFileDialog fd = new OpenFileDialog();
fd.Filter = "sudoku files (*.sudoku)|*.sudoku";
if (fd.ShowDialog() == DialogResult.OK)
{
String[,] csvFields = GDK.CSV.read(fd.FileName);
for (int i = 0; i < 9; i++)
{
for (int j = 0; j < 9; j++) {
if (csvFields[i, j] != "x")
<?php
/** A Game of Thrones **/
$links = array();
$links[] = 'http://awoiaf.westeros.org/index.php/A_Game_of_Thrones-Prologue';
for($i=1; $i<=72; $i++)
$links[] = 'http://awoiaf.westeros.org/index.php/A_Game_of_Thrones-Chapter_'.$i;
$links[] = 'http://awoiaf.westeros.org/index.php/A_Game_of_Thrones-Appendix';
$filename = '1_Game_of_Thrones';
getFiles($links, $filename);
@Avalarion
Avalarion / Javascript.js
Created March 17, 2013 14:40
Create WBBLite2 Hover for WerWarOnline ( WhoWasOnline )
var hoverImage = document.createElement('img');
$$('a.hoverImage').invoke('observe', 'mouseover', function(event) {
if(this.rel != '') {
hoverImage.src = 'wcf/images/avatars/'+this.rel;
hoverImage.setStyle({
position: 'absolute',
left: event.pageX+'px',
top: (event.pageY+10)+'px',
@Avalarion
Avalarion / List.xml
Created June 21, 2013 20:50
Changes for TYPO3 Extension News ( tx_news ): Enable Preview Image in rss-feed Edited File: Templates/News/List.xml
<?xml version="1.0" encoding="utf-8"?>
{namespace n=Tx_News_ViewHelpers}
<rss version="2.0">
<channel>
<title>{settings.list.rss.channel.title}</title>
<link>{settings.list.rss.channel.link}</link>
<description>{settings.list.rss.channel.description}</description>
<language>de</language>
<f:if condition="{settings.list.rss.channel.copyright}">
<copyright>{settings.list.rss.channel.copyright}</copyright>
@Avalarion
Avalarion / Java.java
Created June 27, 2013 23:54
Kleines Beispiel zum Thema Quellen Angabe bei Javas ActionListener für eine Studentin.
package Test;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Java extends Frame{
public static void main(String[] args) {
@Avalarion
Avalarion / whatIsMyIp.sh
Created February 2, 2014 23:17
Get IP via CLI
wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]|.]//g'
@Avalarion
Avalarion / helper.php.sh
Last active November 4, 2016 14:25
First Try with GitLab CI
#!/bin/sh
# Settings for a PHP Project
# Using:
# * PHP Lint
# *- PHP CS
# *- PHP Analyzer
# *- EmptyLines Checker
# *- Scrutinizer
# * PHPCPD