Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Andrew Mager mager

🏠
Working from home
Block or report user

Report or block mager

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:312
<?php echo 'Arquay is nice' ?>
@mager
mager / instaspot-01-application.js
Created Aug 23, 2014
instaspot-01-application.js
View instaspot-01-application.js
(function(){
var client_id = '451cf9fc4a0a44379d699e4ca48d58fb';
var app = angular.module('instaspot', []);
app.factory("InstagramAPI", ['$http', function($http) {
return {
fetchPopular: function(callback){
var endpoint = "https://api.instagram.com/v1/media/popular";
endpoint += "?count=99";
endpoint += "&client_id=" + client_id;
endpoint += "&callback=JSON_CALLBACK";
@mager
mager / instaspot-03-index.html
Created Aug 23, 2014
instaspot-03-index.html
View instaspot-03-index.html
<!doctype html>
<html ng-app="instaspot">
<head>
<title>instaspot</title>
<link href="http://fonts.googleapis.com/css?family=Lato:300,400,700|Karma:400,700" rel="stylesheet" type="text/css" />
<style type="text/css">
body {padding:0;margin:0;font-weight:300;font-family:Lato;}
a {color:#39f;}
header, section {padding:5px 20px;}
@mager
mager / instaspot-01-index.html
Last active Aug 29, 2015
instaspot-01-index.html
View instaspot-01-index.html
<!doctype html>
<html>
<head>
<title>instaspot</title>
</head>
<body>
<header>
<h1>instaspot<span> Find the most popular photos and videos on <a href="http://www.instagram.com">Instagram</a> (refresh for more)</span></h1>
</header>
<section>
@mager
mager / instaspot-02-index.html
Created Aug 23, 2014
instaspot-02-index.html
View instaspot-02-index.html
<!doctype html>
<html ng-app="instaspot">
<head>
<title>instaspot</title>
</head>
<body>
<header>
<h1>instaspot<span> Find the most popular photos and videos on <a href="http://www.instagram.com">Instagram</a> (refresh for more)</span></h1>
</header>
<section ng-controller="ShowImages as images">
@mager
mager / 3-way-switch.groovy
Created Sep 22, 2014
SmartThings SmartApp for 3-Way Switch
View 3-way-switch.groovy
/**
* 3-Way Switch
*
* Copyright 2014 Andrew Mager
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@mager
mager / scheduler-demo.groovy
Last active Aug 29, 2015
Scheduler Demo SmartApp
View scheduler-demo.groovy
/**
* Scheduler Demo
*
* Copyright 2014 Andrew Mager
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@mager
mager / example-restful-switch.groovy
Last active Aug 29, 2015
SmartThings Code Example: RESTful Switch SmartApp
View example-restful-switch.groovy
/**
* Control a Switch with an API call
*
* Copyright 2014 Andrew Mager
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@mager
mager / Gemfile
Created Oct 7, 2014
Example SmartApp Server using OAuth 2
View Gemfile
source "https://rubygems.org"
gem 'sinatra'
gem 'oauth2'
gem 'json'
@mager
mager / on-off-shield.groovy
Last active Aug 29, 2015
On/Off Shield Device Type code
View on-off-shield.groovy
metadata {
definition (name: "On/Off Shield", namespace: "smartthings", author: "SmartThings") {
capability "Actuator"
capability "Switch"
capability "Sensor"
}
// Simulator metadata
simulator {
status "on": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6E"
You can’t perform that action at this time.