Skip to content

Instantly share code, notes, and snippets.

View MartinKnopf's full-sized avatar
🏠
Mucho risky business

Martin Knopf MartinKnopf

🏠
Mucho risky business
View GitHub Profile
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
public class Class : MonoBehaviour {
void Start() {
@MartinKnopf
MartinKnopf / constants.json
Last active January 4, 2018 10:49
raining_ballz_constants
{
"IOS_APP_ID": "???",
"ANDROID_APP_ID": "???",
"GAME_NAME": "Raining Ballz",
"TARGET_SCORE_FACTOR": "0.801",
"BOMBS_PROGRESSION": "0.25",
"MIN_SQUARES": "4",
"MAX_SQUARES_1": "5",
"MAX_SQUARES_2": "6",
"WEBSITE_URL": "http://www.flatbutton.co",
@MartinKnopf
MartinKnopf / steamspy_shortcut.js
Created July 3, 2017 14:27
Userscript for Steam app pages, that appends a link to the title, which leads to the corresponding steamspy page.
// ==UserScript==
// @name steamspy shortcut
// @namespace http:/flatbutton.co/
// @version 1.0
// @author Martin Knopf
// @match http://store.steampowered.com/app/*
// @grant none
// @require https://cdnjs.cloudflare.com/ajax/libs/zepto/1.1.4/zepto.min.js
// ==/UserScript==
@MartinKnopf
MartinKnopf / Eventz.cs
Last active November 20, 2015 00:29
Custom events using CSharp
using UnityEngine;
using System;
public class EventContainer : MonoBehaviour {
public class EmptyEvent {
public delegate void EmptyDelegate();
public event EmptyDelegate Event;
public void Emit() { if(Event != null) Event(); }
}
@MartinKnopf
MartinKnopf / PartiallyTransparentSprite.cs
Created August 20, 2015 13:18
Unity script and shader to apply partial transparency to a sprite (based on Unitys standard sprite shader)
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Random = UnityEngine.Random;
public class PartiallyTransparentSprite : MonoBehaviour {
public SpriteRenderer renderer;
Material material;
List<Color> holes= new List<Color>();
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@MartinKnopf
MartinKnopf / checkout.js
Last active August 29, 2015 13:57
Code Kata #9 'Checkout' in JavaScript (see http://codekata.com/kata/kata09-back-to-the-checkout/)
var _ = require('lodash');
module.exports = Checkout;
function Checkout(pricingRules) {
this.pricingRules = pricingRules;
this.basket = {};
}
Checkout.prototype.scan = function(item) {
@MartinKnopf
MartinKnopf / gist:6278650
Created August 20, 2013 08:25
Replace string in files
for f in `find -name FILENAME`; do cat $f | sed 's/STRING1/STRING2/g' > tmp.txt; mv tmp.txt $f; done
@MartinKnopf
MartinKnopf / CssMerger.java
Last active December 19, 2015 06:49
Wicket: Merging multiple CSS files into one
package org.horsed.wicket.cssmerger;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.wicket.markup.head.CssContentHeaderItem;
import org.apache.wicket.markup.head.CssHeaderItem;
@MartinKnopf
MartinKnopf / init null fields
Created June 28, 2013 22:49
how to init fields of a java class using annotations
@Retention(value=RUNTIME)
@Target({ElementType=FIELD})
public @interface DefaultIfNUll {
String stringValue();
int intValue();
boolean booleanValue();
byte byteValue();
short shortValue();
long longValue();
float floatValue();