Skip to content

Instantly share code, notes, and snippets.

@Avalarion
Avalarion / build_fail_email.html.haml
Created March 8, 2014 14:56
[Attach:] Show Trace in Gitlab CIs Notify Mail
%div{style: "color: white; font-style:monospace; background-color: black; display: block; padding: 5px; width:90%;"}
! Message: #{@build.trace.gsub(/[\n\r]+/,"<br>")}
@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
@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 / 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 / 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 / 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',
<?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);
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")
@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
@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) {