Skip to content

Instantly share code, notes, and snippets.

View RhinoLance's full-sized avatar

Lance Conry RhinoLance

View GitHub Profile
import sys
import os
import time
import io
import scipy.misc
import pprint
from PIL import Image
from skimage import data
from skimage.io import imread
@RhinoLance
RhinoLance / replaceProperties
Last active August 29, 2015 14:02
Replace object properties from other object
var setObjectOptions = function(element, args){
var targetObj = allObjects[element];
for (var prop in args) {
// important check that this is objects own property
// not from prototype prop inherited
if(args.hasOwnProperty(prop)){
targetObj[prop] = args[prop];
}
}
@RhinoLance
RhinoLance / RhinoLib.Leaflet.js
Created June 26, 2014 15:28
Leaflet offline tile caching
/*global L, LocalFileSystem, RhinoLib, async, FileTransfer, Connection */
var cacheMode = {
PRE_CACHE: 0x1,
CACHE_IN_BOUNDS: 0x2,
CACHE_OUTSIDE_BOUNDS: 0x4
};
L.TileLayer.CachedTiles = L.TileLayer.extend({
@RhinoLance
RhinoLance / Angular_code.js
Last active August 29, 2015 14:20
Angular and Jasmine testing withservice using $q
angular.module('MyModule', [])
// DB wrapper
.factory('rsDb', function($q, DB_DEFINITION) {
var self = this;
self.db = null;
self.init = function() {
self.db = window.openDatabase(DB_DEFINITION.name, '1.0', 'database', -1);
var promises = [];
@RhinoLance
RhinoLance / app.component.ts
Created February 14, 2018 22:27
Ionic not displaying page until window resize
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import {Observable} from 'rxjs/Rx';
import { Subject } from "rxjs/Rx";
import { HomePage } from '../pages/home/home';
@Component({
templateUrl: 'app.html'