Skip to content

Instantly share code, notes, and snippets.

View YannickFricke's full-sized avatar
:octocat:
A ❤️ for open source

Yannick Fricke YannickFricke

:octocat:
A ❤️ for open source
View GitHub Profile
@YannickFricke
YannickFricke / gist:1263050
Created October 4, 2011 22:34 — forked from flipflop/gist:1263020
Mobile Detection with Optional Zepto / jQuery include
<?php
$deviceClass = "";
$graduateLevelClass = "";
if (ereg('iPhone',$_SERVER['HTTP_USER_AGENT']) || ereg('iPod',$_SERVER['HTTP_USER_AGENT'])) {
$deviceClass = "ui-iphone";
} else if (ereg('iPad',$_SERVER['HTTP_USER_AGENT'])) {
$deviceClass = "ui-ipad";
} else if (ereg('Android',$_SERVER['HTTP_USER_AGENT']) && ereg('Mobile Safari',$_SERVER['HTTP_USER_AGENT'])) {
$deviceClass = "ui-android";
};
Array
(
[aktiva] => Array
(
[0] => Array
(
[konto] => Bank
[betrag] => 800
)
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})
public @interface ConfigKey
{
String FILE();
@YannickFricke
YannickFricke / ConfigKey.java
Created February 3, 2015 03:07
Conf+ - Nie mehr YAML
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})
public @interface ConfigKey
{
String FILE();
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
return array(
/**
* name of the datasource
*/
"main" => array(
"type" => \Infy\DataSource\InfyDataSourceType::$MYSQL,
"options" => array(
/**
public class CountDown implements Runnable
{
private JavaPlugin plugin;
private int countdown = 0;
private int threadId = 0;
private final Map<Integer, List<CountdownCallback>> callbacks = new HashMap<>();
public CountDown(JavaPlugin plugin, int countdown)
{
@YannickFricke
YannickFricke / JavaPerf.java
Created November 4, 2016 11:31
Java Performance Test
package javaperf;
import java.util.*;
public class JavaPerf
{
private static Map<Integer, UUID> uuidMap = new HashMap<>();
private static List<UUID> uuids = new ArrayList<>();
public static void main(String[] args)

Keybase proof

I hereby claim:

  • I am YannickFricke on github.
  • I am yannickfricke (https://keybase.io/yannickfricke) on keybase.
  • I have a public key whose fingerprint is 88B0 FE73 15E6 AA58 C498 B6EA 54FD 1853 0C3D 52C1

To claim this, I am signing this object:

using System;
using Lappa.ORM;
namespace deployer.Definitions.User
{
[DBTable(Name = "user", Pluralize = false)]
class User : Entity
{
[DBField(Name = "id", Null = false)]
public int Id { get; set; }