Skip to content

Instantly share code, notes, and snippets.

View fasmide's full-sized avatar

Kristian Mide fasmide

  • Aalborg, Denmark
View GitHub Profile
@fasmide
fasmide / dba.php
Created November 9, 2011 12:37
Simpel kommunikation med DBA's api
<?
class DBA {
/**
example params:
'q' => 'yamaha mixer',
'ps' => 20,
'pn' => 1,
'f' => 'json',
'filters' => 1
*/
@fasmide
fasmide / DanskeBank.php
Created November 14, 2011 22:27
Danske Bank console app and php class
<?
class DanskeBank {
private $_magicKey;
private $_curlHandle;
public function __construct()
{
$this->_curlHandle = curl_init();
$data = array(
'os' => 'Android', //hmmf tried with php_uname('s') but then the service rejects logins
'model' => php_uname('m'),
@fasmide
fasmide / usage.java
Created November 16, 2011 22:30
libDanskeBank usage
DanskeBank db = new DanskeBank();
Login l = db.login(LOGINID, LOGINCODE);
Accounts a = db.getAccounts();
//Gets first account
Account b = a.getAccounts().get(0);
//gets the newst 20 transactions
Transactions t = db.getTransactions(b.getAccountId());
@fasmide
fasmide / backedUpPreferences.xml
Created December 7, 2011 01:14
Example: adb push backedUpPreferences.xml /data/data/statoil.denmark/shared_prefs/backedUpPreferences.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="KEY_COFFEES_BOUGHT" value="10" />
</map>
@fasmide
fasmide / gist:1497284
Created December 19, 2011 13:43
Tank_Api balance method output example
<?xml version="1.0" encoding="UTF-8"?>
<Tank_Api generator="zend" version="1.0">
<balance>
<message>Dit kort indeholder 752.20 kr.</message>
<balance>75220</balance>
<status>success</status>
</balance>
</Tank_Api>
@fasmide
fasmide / gist:1497684
Created December 19, 2011 15:28
Tank_Api Capture output example
<?xml version="1.0" encoding="UTF-8"?>
<Tank_Api generator="zend" version="1.0">
<capture>
<message>Der er trukket -10.00 kr. på kortet. Ny Balance: 109.00 kr.</message>
<balance>10900</balance>
<status>success</status>
</capture>
</Tank_Api>
@fasmide
fasmide / dropfeed.php
Created January 23, 2012 10:32
Use this feed togeather with GeekTool - allows you to monitor your dropbox's activity
<?php
/**
* You can find your feed url at http://dropbox.com/events
* The buttom of the page has a Subscribe to feed feature.
*
* Copyright (c) 2012 Kristian Mide
*
* MIT License
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="KEY_DEVICE_IDENTIFIER">08c24947.. muh ..95cd3</string>
</map>
From nobody Fri Apr 27 09:58:18 2012
Received: by 10.50.76.133 with SMTP id k5mr1623118igw.2.1335520697251;
Fri, 27 Apr 2012 02:58:17 -0700 (PDT)
Return-Path: <kristian@mide.dk>
Received: from mail-iy0-f177.google.com (mail-iy0-f177.google.com
[209.85.210.177])
by gmr-mx.google.com with ESMTPS id t9si964354igb.1.2012.04.27.02.58.17
(version=TLSv1/SSLv3 cipher=OTHER);
Fri, 27 Apr 2012 02:58:17 -0700 (PDT)
Received-SPF: neutral (google.com: 209.85.210.177 is neither permitted nor
@fasmide
fasmide / antifacerape.ino
Last active December 27, 2015 01:48
box
#include <Bounce.h>
#include <LiquidCrystal.h>
#define LARGEBTN 10
#define SMALLBTN 11
#define BUZZER 9
Bounce largeBouncer = Bounce( LARGEBTN, 35 );
Bounce smallBouncer = Bounce( SMALLBTN, 5);
LiquidCrystal lcd(2, 3, 4, 5, 6, 7, 8);