Skip to content

Instantly share code, notes, and snippets.

View humanfactors's full-sized avatar
🏳️‍⚧️

Micah K. Wilson humanfactors

🏳️‍⚧️
View GitHub Profile
@humanfactors
humanfactors / hack.py
Created November 20, 2017 06:38 — forked from sburns/hack.py
v1 at converting eprime .txt to pandas.DataFrame
import pandas as pd
F = '/fs0/New_Server/RC_LMS/In_Behavioral/028_207757/PassagesV2_ListA-7757-1.txt'
def parse(f):
data = {}
text = open(f).read().decode('utf-16').replace('\r\n', '\r').splitlines()
start_ind = (i for i, _ in enumerate(text) if _ == '\t\t*** LogFrame Start ***')
end_ind = (i for i, _ in enumerate(text) if _ == '\t\t*** LogFrame End ***')
@humanfactors
humanfactors / atcrenamer.py
Created November 20, 2017 06:37
atc file renaming
import os
import re
PINFO = re.compile(r"data/PID_(.*?)/Day\ (1|2)")
BP = re.compile(r"RandomBullpup_(\d).xml\.(csv|log)")
FN = re.compile(r"EXP3_AltFixFinland_Day(1|2)_Fix_PID-(\w{1,5})\.xml\.(csv|log)")
for root, dirs, files in os.walk("data/"):
for file in files:
#### FUNCTION ####
results = function(Dir,thisFile,ppTimes,pmCraft,conflicts,dismiss){
#thisFile = allFiles[1]
# Results matrix
allResults = as.data.frame(matrix(,nrow=1,ncol = 331))
# get the participant number
part = as.numeric(gsub("[^0-9]+","",substring(thisFile, 7, last = 1000000L)))

Keybase proof

I hereby claim:

  • I am humanfactors on github.
  • I am humanfactors (https://keybase.io/humanfactors) on keybase.
  • I have a public key ASBqqXmIT8kCDyi9Tz9Im5voQN_S9K-bIsRI26MZQAkt_Ao

To claim this, I am signing this object:

@humanfactors
humanfactors / extraction-mover.sh
Created July 13, 2017 11:30
extraction-mover
#! /bin/zsh -
mv analysis/data/exp3_pmdata.csv analysis/data/archive/exp3_pmdata.`date +%m%d%Y`.csv
cp cleaning/extractor/data/py-processed/*.csv(.om[1]) analysis/data/exp3_pmdata.csv
echo "Moved"
#!/usr/bin/python3
"""
Not quite a dysfunctinal docstring
"""
doc = '{s:{c}^{n}}'.format(s = "".join([x for i in [h[1] for t in [enumerate(__doc__.split())] for h in t if h[0] == 4] for x in i][:3]), n = 7, c = '_').strip(' ')
result = "".join(x for x in [str(eval(doc))[i] for i in [3+3+8]])+().__iter__().__class__.__name__[8]+[].__class__.__name__[2]
print(result)
@humanfactors
humanfactors / skankystretch.sh
Last active April 20, 2018 10:34
Debian 9 Stretch Post-Install Configuration
#!/bin/bash
# Last Update: Wednesday 16th March
# Author: Michael Wilson
# Description: Debian Based Distro Post install script
#~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
# -------- README --------
# 1. You should probably manually call the commands in here
# 2. If you do wish do execute it you need to chmod +x the file as root
# 3. Ensure you read relevant warning messages from Michael
import re
import os
import glob
import legacy_restimeinfo as legacyres
resumptiontimes = legacyres.getrestimes()
finaldict = {
'subjectid' : 'string',
'subjectdata' : {
Debian/Linux
============
# Display system information with icon
screenfetch
# Show system and kernel information
uname -a
from collections import OrderedDict
import csv
mainlist = []
fn = open('Finland_Day1_Conflict-Names.csv', 'r')
day1 = csv.reader(fn)
for row in day1:
mainlist.append([row[1],row[2]])
fn.close()