Skip to content

Instantly share code, notes, and snippets.

View uberswe's full-sized avatar

Uberswe uberswe

  • Västerås, Sweden
  • 09:27 (UTC +02:00)
View GitHub Profile
@uberswe
uberswe / automile-trip-test.php
Created October 3, 2016 15:18
Automile trip test
/**
* Created by Markus Tenghamn
*/
ini_set('display_errors', 1);
error_reporting(E_ALL);
$client_id = "";
$client_secret = "";
$scopes = array('read', 'write');
@uberswe
uberswe / slack.php
Created September 14, 2016 19:15
Post updates to Slack with PHP
$message = "Hello this is a test!"; // The message you would like to send
$parameters = array(
'channel' => 'testing', // Simply type your channel name, make sure your bot is invited
'text' => html_entity_decode($message), // Good idea to decode
'as_user' => 'true');
// Use groups.list if you run into channel_not_found issues with private channels, make sure your bot is invited
$url = "https://slack.com/api/"."chat.postMessage"; // chat.postMessage is the method
$parameters['token'] = "MY-API-TOKEN"; // replace MY-API-TOKEN with the API Token for your bot
[
{
"code": "011",
"region": "Norrk\u00f6ping",
"state": "\u00d6sterg\u00f6tlands l\u00e4n"
},
{
"code": "0120",
"region": "\u00c5tvidaberg",
"state": "\u00d6sterg\u00f6tlands l\u00e4n"
@uberswe
uberswe / json.php
Created December 19, 2015 00:21
PFSense simple json API
<?php
/**
* Created by PhpStorm.
* User: Markus Tenghamn
* Date: 18/12/15
* Time: 11:56
*
* Place this in /usr/local/www/ and access it to get basic data about your pfsense installation. Use at your own risk.
*
*/
__author__ = 'MarkusTenghamn'
# cocoa_keypress_monitor.py by Bjarte Johansen is licensed under a
# License: http://ljos.mit-license.org/
# add the terminal application you run python from to application that are allowed to control your computer. This can be done in System Preferences > Privacy > Accessability.
from AppKit import NSApplication, NSApp
from Foundation import NSObject, NSLog
from Cocoa import NSEvent, NSKeyDownMask
from PyObjCTools import AppHelper