Skip to content

Instantly share code, notes, and snippets.

View mattlockyer's full-sized avatar
💭
🥳

Matt Lockyer mattlockyer

💭
🥳
View GitHub Profile
@mattlockyer
mattlockyer / angular-apply-helper.js
Created February 25, 2014 20:51
Angular Apply Helper for Controllers
/*
This gist is intended to be included in controllers and provides an easy way to ensure data is applied
The function: func will be executed within an existing digest $$phase or call $scope.$apply and invoke one
*/
var apply = function(func, callback) {
if(!$scope.$$phase) {
$scope.$apply(function() {
func();
if (callback) callback();
var el = this.el;
el.style.display = 'none';
el.offsetHeight;
el.style.display = 'block';
IAT 381 Lab Outline
Learning Outcomes:
ability to implement a mobile application using fundamental web technologies and leading industry frameworks, tools and best practices
develop skills in reading documentation and apis to implement unique application features using frameworks, libraries and web services
practice generalization in programming and problem solving
Delivery Format:
@mattlockyer
mattlockyer / OBJ.js
Last active August 29, 2015 14:12
Minimal Implementation of Eric Elliot's Stampit
var OBJ = {
create:function(obj) {
return (function() {
var priv = {};
var pub = {
__proto__:obj ? obj.__proto__ : {},
setPriv:function(name, value) {
priv[name] = value;
},
getPriv:function(name) {
how can i tell my layout to change? CSS Media query
designing for device screen sizes
navigation bars and placement
app guidelines vs os
content layout vs. navigation ui layout (guidelines not necc. equal)
@mattlockyer
mattlockyer / index.html
Created March 17, 2015 19:53
iat381-drive-realtime-example
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Google Drive Realtime quickstart</title>
<meta http-equiv="X-UA-Compatible" content="IE=9">
<!-- Load the Realtime libraries. -->
<script type="text/javascript"
src="https://apis.google.com/js/api.js"></script>
@mattlockyer
mattlockyer / app.js
Last active August 29, 2015 14:17
Google Drive Realtime API Tic Tac Toe
var APP = angular.module('APP', []);
APP.controller('gameController', function($scope) {
$scope.gameReady = false;
$scope.chatInput = '';
var wins = [
@mattlockyer
mattlockyer / remove-banner.js
Last active October 16, 2015 04:10
F*** Pintrest Signup Page Blocker
//Scroll down until you see FULL PAGE SIGNUP
//Paste into console in Chrome or whatever (F11)
//Hit enter
var el = document.querySelector('.fullScreenBanner');
el.parentNode.removeChild(el);
@mattlockyer
mattlockyer / Mobile JS Console
Created November 25, 2015 00:56
No line numbers but you can log(...msg...) to this console and see it on a mobile device
//mobile console
(function() {
var el = document.createElement('div'),
s = el.style;
//s.display = 'none'; //enable for production
s.position = 'fixed';
s.bottom = '0px';
s.left = '0px';
s.background = 'white';
s.width = '100%';
@mattlockyer
mattlockyer / test.js
Created April 15, 2017 16:10
Testing Immutable.js as data store that will always point to the most updated reference of the map
//with store
const STORE = {
head: new Map(),
undo: () => {
const action = STORE.queue.pop();
STORE.head = STORE.queue[STORE.queue.length - 1];
return action;
},
queue: []
};