Skip to content

Instantly share code, notes, and snippets.

View sp90's full-sized avatar
🦜
Focusing

Simon sp90

🦜
Focusing
View GitHub Profile
@sp90
sp90 / designer.html
Created June 12, 2014 13:16
designer
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@sp90
sp90 / swipeFunc.js
Last active August 29, 2015 14:08 — forked from localpcguy/swipeFunc.js
var swipeFunc = {
touches : {
"touchstart": {"x":-1, "y":-1},
"touchmove" : {"x":-1, "y":-1},
"touchend" : false,
"direction" : "undetermined"
},
touchHandler: function(event) {
var touch;
if (typeof event !== 'undefined'){
(function() {
'use strict';
/**
* # numeric[module]
*/
/**
*
* # Dependent
for (var i = 1; i < 101; i++) {
var buzz = (i % 5 == 0) ? 'Buzz' : i;
var fizz = (i % 3 == 0) ? 'Fizz' : buzz;
var fizzBuzz = (i % 3 == 0 && i % 5 == 0) ? 'FizzBuzz' : fizz;
console.log("fizzBuzz: ", fizzBuzz);
}
function getScrollPosition() {
var last_known_scroll_position = 0;
var ticking = false;
var bodyEl = document.body;
var htmlEl = document.documentElement;
var height = Math.max(bodyEl.scrollHeight, bodyEl.offsetHeight,
htmlEl.clientHeight, htmlEl.scrollHeight, htmlEl.offsetHeight);
window.addEventListener('scroll', function(e) {
last_known_scroll_position = window.scrollY;
@sp90
sp90 / locationImage.js
Created May 26, 2016 11:22
Just a solution to google street view no imagry, needs some rewriting but it work
angular
.module('bolighed')
.directive('locationImage', LocationImage);
function LocationImage($q, $sce, $window, streetviewService) {
var apiKey = window.bolighed.google_api_key;
var staticMapApiEndPoint = 'https://maps.googleapis.com/maps/api/staticmap';
var streetviewApiEndPoint = 'https://maps.googleapis.com/maps/api/streetview';
@sp90
sp90 / Horizon angular 1.x
Last active September 7, 2016 11:36
A small helper to hook up to horizon
(function() {
'use strict';
angular.module('myApp')
.factory('horizon', horizonFactory);
function horizonFactory() {
var horizon = Horizon({
host: 'localhost:8181',
secure: true,
/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i
@sp90
sp90 / app.js
Created September 27, 2016 09:19
Static site generator
// Native modules
var path = require('path');
var fs = require('fs');
// Third party modules
var _ = require('lodash');
var config = {
numberOfPosts: 10000,
template: function(name) {