I hereby claim:
- I am nigelbabu on github.
- I am nigelb (https://keybase.io/nigelb) on keybase.
- I have a public key whose fingerprint is 7C28 A588 42BA 7E00 7FC8 58EC 3181 30D0 CE77 562F
To claim this, I am signing this object:
| #!/usr/bin/env python | |
| from fnmatch import fnmatch | |
| import sys | |
| matched = False | |
| with open('.testignore') as ignore: | |
| for pattern in ignore: | |
| if fnmatch(sys.argv[2], pattern.strip()): | |
| matched = True | |
| break |
I hereby claim:
To claim this, I am signing this object:
| CALL CSVWRITE('/tmp//migrate/ACCOUNTS', 'SELECT * FROM ACCOUNTS'); | |
| CALL CSVWRITE('/tmp//migrate/ACCOUNT_DIFF_PREFERENCES', 'SELECT * FROM ACCOUNT_DIFF_PREFERENCES'); | |
| CALL CSVWRITE('/tmp//migrate/ACCOUNT_EXTERNAL_IDS', 'SELECT * FROM ACCOUNT_EXTERNAL_IDS'); | |
| CALL CSVWRITE('/tmp//migrate/ACCOUNT_GROUPS', 'SELECT * FROM ACCOUNT_GROUPS'); | |
| CALL CSVWRITE('/tmp//migrate/ACCOUNT_GROUP_BY_ID', 'SELECT * FROM ACCOUNT_GROUP_BY_ID'); | |
| CALL CSVWRITE('/tmp//migrate/ACCOUNT_GROUP_BY_ID_AUD', 'SELECT * FROM ACCOUNT_GROUP_BY_ID_AUD'); | |
| CALL CSVWRITE('/tmp//migrate/ACCOUNT_GROUP_MEMBERS', 'SELECT * FROM ACCOUNT_GROUP_MEMBERS'); | |
| CALL CSVWRITE('/tmp//migrate/ACCOUNT_GROUP_MEMBERS_AUDIT', 'SELECT * FROM ACCOUNT_GROUP_MEMBERS_AUDIT'); | |
| CALL CSVWRITE('/tmp//migrate/ACCOUNT_GROUP_NAMES', 'SELECT * FROM ACCOUNT_GROUP_NAMES'); | |
| CALL CSVWRITE('/tmp//migrate/ACCOUNT_PATCH_REVIEWS', 'SELECT * FROM ACCOUNT_PATCH_REVIEWS'); |
| WSGISocketPrefix /var/run/wsgi | |
| <VirtualHost 127.0.0.1:8080> | |
| ServerName myinstance.ckan.net | |
| ServerAlias www.myinstance.ckan.net | |
| WSGIScriptAlias / /etc/ckan/default/apache.wsgi | |
| # pass authorization info on (needed for rest api) | |
| WSGIPassAuthorization On |
I hereby claim:
To claim this, I am signing this object:
| curl -H 'Authorization: yourapikeyhere' http://demo.ckan.org/api/action/group_purge -d '{"id": "test-test-test-test-tes-t"}' | |
| # Alternatively, you can also use the ckanapi | |
| import ckanapi | |
| ckan = ckanapi.RemoteCKAN('http://demo.ckan.org', apikey='yourapikey') | |
| result = ckan.action.group_purge(id='test-test-test-test') | |
| print result |
| class PartnerGroupClass(plugins.SingletonPlugin, DefaultGroupForm): | |
| plugins.implements(plugins.IGroupForm, inherit=True) | |
| ## IGroupForm | |
| def is_fallback(self): | |
| return True | |
| def group_types(self): | |
| return ['organization'] | |
| #!/usr/bin/env python | |
| def with_lambda(hours=[]): | |
| days = map(lambda x: x/8.0, hours) | |
| total_days = reduce(lambda x, y: x+y, days) | |
| return days, total_days | |
| def without_lambda(hours=[]): |
| #!/usr/bin/env python | |
| import requests | |
| import json | |
| def main(): | |
| # Change this to actual API key | |
| apikey = 'XXX' | |
| # Change if required to correct CKAN url. No trailing slash. | |
| ckan_url = 'http://127.0.0.1:5000' |
| # with lambda | |
| pkg_dict['resources'] = filter(lambda x: x.get('id') != id, pkg_dict.get('resources', [])) | |
| #without lambda | |
| for res in pkg_dict.get('resources', []): | |
| if res.get('id') == id: | |
| pkg_dict['resources'].remove(id) |