Skip to content

Instantly share code, notes, and snippets.

View jimoneil's full-sized avatar

Jim O'Neil jimoneil

View GitHub Profile
@jimoneil
jimoneil / gist:2c8d406031c375f444bd
Created March 16, 2015 23:56
Chuck Norris Edison IoT Demo
var request = require('request');
var mraa = require('mraa');
var myButton = new mraa.Gpio(3);
myButton.dir(mraa.DIR_IN);
var LCD = require('jsupm_i2clcd');
var myLCD = new LCD.Jhd1313m1(0, 0x3E, 0x62);
var processingRequest = false;
@jimoneil
jimoneil / gist:7280364
Last active December 27, 2015 06:19
Snippets for APIMASH tutorial
<Page.Resources>
<DataTemplate x:Key="TeamItemTemplate">
<Grid Width="250" Height="250">
<Grid.RowDefinitions>
<RowDefinition Height="161*"/>
<RowDefinition Height="51*"/>
<RowDefinition Height="38*"/>
</Grid.RowDefinitions>
<Rectangle Fill="#FFF4F4F5" Stroke="Black"/>
<TextBlock Grid.Row="1" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Center" TextAlignment="Center" FontSize="16"/>
@jimoneil
jimoneil / gist:5591962
Created May 16, 2013 14:04
Windows 8 settings flyout script demonstrating how to interact with Construct 2 global variables
var customizer = (function () {
"use strict";
var t = {};
//flip the RGB components
function flipRGB(colorIn)
{
var part1 = colorIn & 0xFF0000;
var part2 = colorIn & 0xFF00;
@jimoneil
jimoneil / gist:5569410
Created May 13, 2013 16:01
code sample for hooking up Callisto controls to Settings flyout in a Windows Store app
// LICENSE: http://opensource.org/licenses/ms-pl
//
// This gist contains code that references the open source Callisto toolkit (http://callistotoolkit.com/)
// implementation of OnNavigated to for a given page in a Windows Store App
protected override void OnNavigatedTo(NavigationEventArgs e)
{
// handle Settings pane options
@jimoneil
jimoneil / WNSHelper.cs
Created November 8, 2012 07:04
Sample code for OAuth and push notification handling for Windows Store applications
/*
Copyright (c) Microsoft
All rights reserved.
Licensed under the Microsoft Limited Public License (the “License”); you may not
use this file except in compliance with the License.
You may obtain a copy of the License at http://msdn.microsoft.com/en-us/cc300389.
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS
OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
/*
Copyright (c) Microsoft
All rights reserved.
Licensed under the Microsoft Limited Public License (the “License”); you may not
use this file except in compliance with the License.
You may obtain a copy of the License at http://msdn.microsoft.com/en-us/cc300389.
@jimoneil
jimoneil / server.js
Created July 26, 2012 22:21
Proxy Windows 8 notification image requests to Windows Azure Storage after interpreting query parameters resulting from addImageQuery
/*
Copyright (c) Microsoft
All rights reserved.
Licensed under the Microsoft Limited Public License (the “License”); you may not
use this file except in compliance with the License.
You may obtain a copy of the License at http://msdn.microsoft.com/en-us/cc300389.
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS
OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.