Skip to content

Instantly share code, notes, and snippets.

@irae
irae / _Stay_standalone.md
Last active January 29, 2024 12:38 — forked from kylebarrow/example.html
Stay Standalone: Prevent links in standalone web apps opening Mobile Safari

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.

@mattdesl
mattdesl / shadows.java
Created April 1, 2013 19:53
2D shadows in LibGDX
static Vector2 L = new Vector2();
static Vector2 N = new Vector2();
static Vector2 tmp = new Vector2();
static Vector2[] points = new Vector2[] {
new Vector2(), new Vector2(), new Vector2(), new Vector2()
};
static Vector2[] tmpBoundary = new Vector2[] {
new Vector2(), new Vector2()
};
package net.minecraft.launcher.authentication;
import net.minecraft.launcher.Http;
import java.io.IOException;
import java.net.Proxy;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
package mdesl.line2dx.test;
/*******************************************************************************
* Copyright 2011 See AUTHORS file.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@JeffreyWay
JeffreyWay / .bash_profile
Created May 8, 2013 18:02
Laravel aliases
# laravel new-app
alias laravel="git clone -o laravel -b develop https://github.com/laravel/laravel.git"
alias artisan="php artisan"
alias migrate="php artisan migrate"
alias serve="php artisan serve"
alias dump="php artisan dump"
alias t="phpunit"
# Generators Package
@Dinnerbone
Dinnerbone / gist:5631634
Last active May 14, 2020 12:41
New chat system for Minecraft. The server won't translate any text for the client, and there'll be a proper stack based colouring/formatting system, so no more leaking colours, english-only messages, or out of date translations.
{
"color": "yellow",
"translate": "multiplayer.player.joined",
"using": [
"Dinnerbone"
]
}
{
"color": "gray",
@Dinnerbone
Dinnerbone / gist:5662824
Created May 28, 2013 13:38
As an essential step towards the Minecraft modding API, and also for sanity's sake in our own code, we're removing Texture Packs and replacing them with a new Resource Pack system. Ultimately, every mod/plugin will be its own resource pack, vanilla will be a resource pack by itself, and users will be able to apply multiple resource packs at once…
{
"//comment": "All metainfo files will be ORIGINAL_FILE.mcmeta. For example, textures/blocks/portal.png.mcmeta. The format is, of course, JSON.",
"animation": {
"//comment": "This block will be required for animated textures. It can be an empty block, but it will be needed to detect an animation.",
"frames": [
1,
{"index": 2, "time": 4},
3,
4
],
@aadnk
aadnk / AttributeStorage.java
Created September 29, 2013 17:12
Store arbitrary data on an ItemStack safely by using attributes. Use the following attribute class: https://gist.github.com/aadnk/6754159
package com.comphenix.example;
import java.util.UUID;
import org.bukkit.inventory.ItemStack;
import com.comphenix.example.Attributes.Attribute;
import com.comphenix.example.Attributes.AttributeType;
import com.comphenix.example.Attributes.Operation;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
{
"version": {
"name": "13w41a",
"protocol": 0
},
"players": {
"max": 100,
"online": 5,
"sample":[
{"name":"Thinkofdeath", "id":""}
@maruohon
maruohon / log4j2.xml
Last active September 17, 2021 10:08
Minecraft server logging configuration file for Minecraft 1.7.2+
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<File name="legacy_server_log" fileName="server.log">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%level] %msg%n" />
</File>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%level] %msg%n" />
</Console>