Skip to content

Instantly share code, notes, and snippets.

View iandouglas's full-sized avatar

w. ian douglas iandouglas

View GitHub Profile
@iandouglas
iandouglas / gist:10441406
Last active August 29, 2015 13:59
How do I write a unit test to check that my code throws a CapabilityDisabledError when writing to GAE's datastore during an outage?
# coding=utf-8
import unittest
from google.appengine.api import users, capabilities
from google.appengine.ext import testbed
from google.appengine.runtime.apiproxy_errors import CapabilityDisabledError
from models.user import User
class TestDatastoreDown(unittest.TestCase):
def setUp(self):
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
#core_scaffold {
position: absolute;
top: 0px;
right: 0px;

The 10 Commandments of Modern Web Application

1. Instant Access

  • No Flash, Java or other plugins

2. Responsive Design

  • Responsive Layout
  • Mobile First
### Keybase proof
I hereby claim:
* I am iandouglas on github.
* I am iandouglas (https://keybase.io/iandouglas) on keybase.
* I have a public key whose fingerprint is F8F9 D70D 75D2 DADB 6C99 7581 6791 58AD 1C64 9359
To claim this, I am signing this object:
curl -XPOST http://localhost:8098/types/location_type/buckets/people/datatypes/person1 \
-H "Content-Type: application/json" \
-d '
{
"update": { "username_register": "user1", "city_register": "Denver", "state_register": "NY", "position_register": "42.27,-74.53" }
}'
curl -XPOST http://localhost:8098/types/location_type/buckets/people/datatypes/person2 \
-H "Content-Type: application/json" \
-d '
curl -XPOST http://localhost:8098/types/location_type/buckets/people/datatypes/person1 \
-H "Content-Type: application/json" \
-d '
{
"update": { "username_register": "user1", "city_register": "Denver", "state_register": "NY", "position_register": "42.27,-74.53" }
}'
curl -XPOST http://localhost:8098/types/location_type/buckets/people/datatypes/person2 \
-H "Content-Type: application/json" \
-d '
import shutil
!mkdir dreamed
frame_i = 0
for i in xrange(firstnum, secondnum):
img = np.float32(PIL.Image.open('/src/'+ str(i) +'.jpg'))
showarray(img)
frame = img
h, w = frame.shape[:2]
s = 0.05 # scale coefficient
### Keybase proof
I hereby claim:
* I am iandouglas on github.
* I am iandouglas (https://keybase.io/iandouglas) on keybase.
* I have a public key ASD19ilqDDzCsw3KF-uExGHh1FvA2mwY6RALZH9DxcmhkQo
To claim this, I am signing this object:
@iandouglas
iandouglas / AndroidManifest.xml
Last active November 10, 2016 00:48
Stuck on styling a taskstack toolbar on the launched activity
...
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity