Skip to content

Instantly share code, notes, and snippets.

@malles
malles / JsonSerializer.php
Last active September 5, 2018 12:43
Returns array of data from TwinfieldApi objects for json_encode
<?php
use PhpTwinfield\Customer;
use PhpTwinfield\CustomerAddress;
use PhpTwinfield\CustomerBank;
use PhpTwinfield\Exception;
use PhpTwinfield\Supplier;
use PhpTwinfield\SupplierAddress;
use PhpTwinfield\SupplierBank;
@malles
malles / tablefix.user.js
Created September 23, 2016 19:59
Fix alerts table
// ==UserScript==
// @name Fix Alert Tables
// @namespace http://bixie.org/
// @version 0.1
// @description Kill the frogs!
// @author You
// @match https://www.ingress.com/intel
// @grant none
// ==/UserScript==
@malles
malles / lmgtfy.py
Created September 8, 2016 17:15
Create short urls and lmgtfy urls in your Hangupsbot
import asyncio
from urllib.request import urlopen
import plugins
def _initialise(bot):
plugins.register_user_command(["lmgtfy"])
plugins.register_user_command(["shorten"])
@malles
malles / simple_events.py
Created September 8, 2016 16:09
Events for Hangupsbot (copy of tl;dr plugin)
import time
import plugins
def _initialise(bot):
plugins.register_user_command(["events"])
bot.register_shared("plugin_events_shared", tldr_shared)
def events(bot, event, *args):
@malles
malles / wikia.py
Created September 8, 2016 16:07
Lookup Ingress Wikia facts via your Hangups bot
import asyncio, json, re
import urllib
import plugins
TAG_RE = re.compile(r'<[^>]+>')
ELLIP_RE = re.compile(r'&hellip;')
@malles
malles / draw.py
Created September 8, 2016 16:05
Draw simple polygon on Google Maps for Hangupsbot
import asyncio, aiohttp, io, logging, time
import urllib
import plugins
logger = logging.getLogger(__name__)
# somethin new
# somethin new
@malles
malles / baconipsum.py
Created September 8, 2016 16:04
Bacon ipsum plugin for Hangupsbot
import asyncio, json, logging
import urllib
import plugins
logger = logging.getLogger(__name__)
def _initialise(bot):
@malles
malles / cart.vue
Created August 10, 2016 21:41
Cart Vue example
<template>
<div id="bix-cart">
<v-modal v-ref:modal modifier="uk-modal-dialog-blank">
<partial :name="modal_template"></partial>
</v-modal>
</div>
</template>
@malles
malles / DateHelper.php
Created June 24, 2016 09:39
Datehelper for Pagekit, not perfect!
<?php
namespace Bixie\Freighthero\Helpers;
use Pagekit\Application as App;
class DateHelper {
@malles
malles / gmaps-autocompete.vue
Created June 1, 2016 12:11
Google Maps Autocomplete Freighthero
<template>
<div class="uk-form-password uk-width-1-1">
<a v-show="search != ''" @click="clearAddress" class="uk-form-password-toggle uk-icon-close uk-icon-hover"></a>
<input type="text" v-el:search v-model="search" :class="inputclass" @keyup.enter.stop="">
</div>
</template>
<script>