Skip to content

Instantly share code, notes, and snippets.

@amiuhle
amiuhle / metrobone.js
Last active December 18, 2015 16:39 — forked from jrtipton/metrobone.js
// Metrobone.js 0.0.1
//
// J.R. Tipton @jrtipton
// Metrobone is a wimpy little utility library for
// making Backbone.js integrate with WinJS controls
// (for Windows 8 development) a little easier.
//
// Two basic ways to use this overly verbose little
// guy:
//
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#
@amiuhle
amiuhle / .gitconfig
Last active December 25, 2015 20:59
My git config
[color]
branch = auto
diff = auto
interactive = auto
status = auto
[alias]
co = checkout
s = status
d = diff
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
require 'formula'
class Phpunit < Formula
homepage 'http://www.phpunit.de/manual/current/en/index.html'
url 'http://pear.phpunit.de/get/phpunit.phar'
sha1 '7aaa26086ddf7cd0c517d7f52b74a53a7a1d7e29'
version 'HEAD'
def install
bin.install "phpunit.phar" => "phpunit"
@amiuhle
amiuhle / component.html
Last active August 29, 2015 14:01
input fields in polymer
<polymer-element name="my-checkbox" attributes="name value checked">
<template> <!-- main template, renders to shadow root --></template>
<template id="foo">
<input type="hidden" name="{{name}}" value="{{checked ? value : 0}}" />
</template>
<script>
(function() {
Polymer('my-checkbox', {
ready: function() {
// this.element is `polymer-element`
@amiuhle
amiuhle / designer.html
Last active August 29, 2015 14:06
designer
<link rel="import" href="../core-ajax/core-ajax.html">
<polymer-element name="tw-world" host="de109.die-staemme.de">
<template>
<style>
:host {
width: 100%;
height: 100%;
box-sizing: border-box;
@amiuhle
amiuhle / tw-simulator.js
Last active January 14, 2024 09:40
Tribal Wars building duration calculation
/*
* Installation: Save as snippet in Chrome DevTools. (Crtl + Shift + i, Tab 'Sources', Sub-Tab 'Snippets', right-click, 'New')
*
* Usage:
* 1) Go to http://<your-world>.die-staemme.de/interface.php?func=get_building_info
* 2) Adjust the 'currentMain' and 'jobs' to match your main building at start and the build jobs you want to simulate.
* 3) Run snippet.
*/
(function() {
'use strict';
@amiuhle
amiuhle / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../paper-input/paper-input.html">
<polymer-element name="audio-player" attributes="audioUrl" audiourl="http://swr-mp3-m-swr3.akacast.akamaistream.net/7/720/137136/v1/gnl.akacast.akamaistream.net/swr-mp3-m-swr3">
<template>
<style>
@amiuhle
amiuhle / supportsOverlayBlendMode.js
Created November 3, 2016 09:08
supportsOverlayBlendMode.js
const supportsOverlayBlendMode = (() => {
const canvas = document.createElement('canvas')
canvas.width = canvas.height = 1
const ctx = canvas.getContext('2d')
const bounds = [0, 0, 1, 1]
ctx.globalCompositeOperation = 'overlay'
ctx.fillStyle = '#000000'
ctx.fillRect(...bounds)
ctx.fillStyle = '#ffffff'