Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import getpass
import os
import sys
import mobileworks as mw
mw.username = 'mdrcode'
if "MWPASS" in os.environ:
#!/usr/bin/env python
import getpass
import os
import sys
import mobileworks as mw
# incomplete list of Asian country 2-letter codes
asian_countries = ['AF', 'BD', 'MM', 'KH', 'CN', 'GE', 'HK',
'IN', 'ID', 'JP', 'KR', 'LA', 'MO', 'MY',
#!/usr/bin/env python
import getpass
import os
import sys
import mobileworks as mw
blocked_workers = ['138-897-73105', '5454-4963-404484', '3083-2592-211248']
# incomplete list of Asian country 2-letter codes
# Beauty and Grooming
Always - women's hygiene
Braun - personal electrical appliances eg razors
Clairol Professional - women's hair products
CoverGirl - women's makeup
Crest - toothpaste
Fusion - men's razors (ie Gillette Fusion)
Gillette - men's grooming, shaving
Head & Shoulders - shampoo
#!/usr/bin/env python
import getpass
import os
import sys
import mobileworks as mw
blocked_workers = ['138-897-73105', '5454-4963-404484', '3083-2592-211248']
mw.username = 'mdrcode'
import sys
from itertools import islice
def window(seq, n=2):
"Returns a sliding window (of width n) over data from the iterable"
" s -> (s0,s1,...s[n-1]), (s1,s2,...,sn), ... "
it = iter(seq)
result = tuple(islice(it, n))
if len(result) == n:
2013-06-22T18:46:09.284 632
2013-06-24T02:21:02.509 356
2013-06-25T00:00:01.656 413
2013-06-25T12:00:01.431 365
2013-06-26T00:00:01.930 380
2013-06-26T12:00:01.619 360
2013-06-27T00:00:01.081 380
2013-06-27T12:00:02.043 405
2013-06-28T00:00:01.662 370
2013-06-28T12:00:01.714 377
@mdrcode
mdrcode / gist:7377936
Created November 8, 2013 21:25
new specs added by Japan Staples list
SPEC_NOT_FOUND: 2. Seafood - Clams, Sashimi
SPEC_NOT_FOUND: 2. Seafood - Fish, Sashimi
SPEC_NOT_FOUND: 2. Seafood - Mussels, Sashimi
SPEC_NOT_FOUND: 2. Seafood - Prawns, Fresh
SPEC_NOT_FOUND: 2. Seafood - Prawns, Frozen
SPEC_NOT_FOUND: 2. Seafood - Salmon
SPEC_NOT_FOUND: 2. Seafood - Scallop, Sashimi
SPEC_NOT_FOUND: 2. Seafood - Shrimp, Sashimi
SPEC_NOT_FOUND: Beverages - Barley Tea
SPEC_NOT_FOUND: Beverages - Black tea
GOOD_SPEC_MISSING_BUNDLES: Other (Pork) (fc3f6415-1cc0-4ce6-849a-0ae18e6e7ee1) MISSING 2
ADD_GOOD_SPEC_TO_BUNDLE: Other (Pork) - fc3f6415-1cc0-4ce6-849a-0ae18e6e7ee1 - de-staples-meat+seafood+dairy
200
ADD_GOOD_SPEC_TO_BUNDLE: Other (Pork) - fc3f6415-1cc0-4ce6-849a-0ae18e6e7ee1 - gb-staples-meat+seafood+dairy
200
BAD_SPEC_STILL_IN_BUNDLES: 19db9d79-51d4-464a-83c2-e24da8e3c74e in 3
REMOVE_BAD_SPEC_FROM_BUNDLE: 19db9d79-51d4-464a-83c2-e24da8e3c74e - {u'id': u'707b8cbf-055c-41e3-87f8-abf22d0d9cd6', u'name': u'gb-staples-meat+seafood+dairy'}
200
REMOVE_BAD_SPEC_FROM_BUNDLE: 19db9d79-51d4-464a-83c2-e24da8e3c74e - {u'id': u'c14a9ca0-56fa-4ff1-92ef-def574d586f9', u'name': u'de-staples-meat+seafood+dairy'}
200
@mdrcode
mdrcode / gist:8815011
Last active March 28, 2018 15:23
Premise Android Coding Test

Premise Android Coding Test - Github Events API

This is a simple coding test intended to demonstrate the candidate's ability regarding:

  • Java
  • Android
  • Web Services
  • Offline Communication (docs, commit messages, etc)

Please do not spend more than a few hours on this, at max. If you do not complete the project, that is OK. The intent is to demonstrate your knowledge, skill, and communication as you approach a project (good, disciplined effort that gets 80% of the way in 3 hours is much better than a hacky, low-quality project that gets it 'done' in 2 hours).