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 B56F A933 0BC3 2826 6E45 34DB 7CCD F059 5F29 8CF1
To claim this, I am signing this object:
# 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) |
#!/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' |
#!/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=[]): |
class PartnerGroupClass(plugins.SingletonPlugin, DefaultGroupForm): | |
plugins.implements(plugins.IGroupForm, inherit=True) | |
## IGroupForm | |
def is_fallback(self): | |
return True | |
def group_types(self): | |
return ['organization'] | |
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 |
I hereby claim:
To claim this, I am signing this object:
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 |
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'); |
I hereby claim:
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 |