Skip to content

Instantly share code, notes, and snippets.

View mager's full-sized avatar
🏠
Working from home

Mager mager

🏠
Working from home
View GitHub Profile
<?php echo 'Arquay is nice' ?>
@mager
mager / instaspot-01-index.html
Last active August 29, 2015 14:05
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-01-application.js
Created August 23, 2014 03:21
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-02-index.html
Created August 23, 2014 03:47
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 / instaspot-03-index.html
Created August 23, 2014 04:05
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 / 3-way-switch.groovy
Created September 22, 2014 18:07
SmartThings SmartApp for 3-Way Switch
/**
* 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 August 29, 2015 14:06
Scheduler Demo SmartApp
/**
* 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 August 29, 2015 14:07
SmartThings Code Example: RESTful Switch SmartApp
/**
* 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 October 7, 2014 16:40
Example SmartApp Server using OAuth 2
source "https://rubygems.org"
gem 'sinatra'
gem 'oauth2'
gem 'json'
@mager
mager / on-off-shield.groovy
Last active August 29, 2015 14:07
On/Off Shield Device Type code
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"