Skip to content

Instantly share code, notes, and snippets.

View adamobeng's full-sized avatar

Adam Obeng adamobeng

View GitHub Profile
@adamobeng
adamobeng / pre-commit
Created November 19, 2016 14:48
Git pre-commit hook to remove non-breaking spaces from R files
#!/usr/bin/env python3
import subprocess
files = subprocess.check_output(
'git diff --cached --name-only --diff-filter=ACM *R', shell=True
).decode().strip().split('\n')
files = [f for f in files if f!='']
for f in files:

Keybase proof

I hereby claim:

  • I am adamobeng on github.
  • I am adamobeng (https://keybase.io/adamobeng) on keybase.
  • I have a public key whose fingerprint is 6C69 D5F3 40F2 4609 D4F7 D957 3F56 9E5E 5FBD 73D7

To claim this, I am signing this object:

{
"search_metadata": {
"completed_in": 0.035,
"count": 4,
"max_id": 250126199840518145,
"max_id_str": "250126199840518145",
"next_results": "?max_id=249279667666817023&q=%23freebandnames&count=4&include_entities=1&result_type=mixed",
"query": "%23freebandnames",
"refresh_url": "?since_id=250126199840518145&q=%23freebandnames&result_type=mixed&include_entities=1",
"since_id": 24012619984051000,
@adamobeng
adamobeng / uni2name.py
Created October 24, 2013 21:26
Convert Columbia UNIs to names, etc
#!env python
@adamobeng
adamobeng / graph.dot
Created March 8, 2013 22:28
Response to this SOCNET post <http://lists.ufl.edu/cgi-bin/wa?A2=ind1303&L=SOCNET&T=0&F=&S=&P=185750> Copyright (C) 2013 Adam Obeng Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limit…
strict digraph "fast_gnp_random_graph(10,0.2)" {
1 -> 0 [weight=0.85784681863];
1 -> 9 [weight=0.446412404196];
1 -> 6 [weight=0.154317919969];
2 -> 5 [weight=0.625265147359];
2 -> 6 [weight=0.646490491015];
3 -> 0 [weight=0.0314493433996];
3 -> 1 [weight=0.679579531344];
4 -> 5 [weight=0.839968183284];
5 -> 1 [weight=0.325702378388];
# I'm not sure this is correct, but it seems reasonable
# Copyright (c) 2012 Adam Obeng
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISI
@adamobeng
adamobeng / subgraphs.py
Created March 7, 2012 15:59
Random sub-samples of a network in python-igraph
# Copyright (c) 2012 Adam Obeng
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR T