Skip to content

Instantly share code, notes, and snippets.

View bazbt3's full-sized avatar

bazbt3 bazbt3

View GitHub Profile
@bazbt3
bazbt3 / Pythonista six module winreg bug.txt
Last active February 1, 2018 21:59
Pythonista's `six` module bug: @thrrgilag's fix/workaround after my pain!
('pnut developers' chatroom; PigPen app output)
@bazbt3: [u:175+f+F]
2018-02-01 16:06:48+00:00
Did any of you have issues with Python not working correctly yesterday? PIL failed to import, but works today. pillow failed but works today. The PNUTpy library fails to import but only for pythonista.
---------------------------------
@33MHz: [u:1+f+F]
2018-02-01 16:08:17+00:00
@bazbt3 PNUTpy is working elsewhere? (it was just recently updated)
---------------------------------
@bazbt3
bazbt3 / PigPen_traceback_from_Pythonista
Created January 31, 2018 14:31
PNUTpy 0.2.2 breaks at `import pnutpy` - traceback attached
```
Traceback (most recent call last):
File "/var/containers/Bundle/Application/6C68ED93-06A2-4F12-AF56-3B398F5CC8A4/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/six.py", line 127, in __getattr__
_module = self._resolve()
File "/var/containers/Bundle/Application/6C68ED93-06A2-4F12-AF56-3B398F5CC8A4/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/six.py", line 111, in _resolve
return _import_module(self.mod)
File "/var/containers/Bundle/Application/6C68ED93-06A2-4F12-AF56-3B398F5CC8A4/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/six.py", line 78, in _import_module
__import__(name)
ModuleNotFoundError: No module named 'winreg'
@bazbt3
bazbt3 / secretsantagiftchooser.py
Last active November 29, 2017 19:03
Secret Santa gift chooser
# Secret Santa gift chooser
# @bazbt3
import random
items = ["suits", "flange", "nipple", "socket", "lubricant", "gusset", "spigot", "Cairo!"]
print("initial list\n", items)
i = 0
for item in items:
i += 1
while i != 0:
@bazbt3
bazbt3 / PigPen_v0.0000001.py
Last active October 28, 2017 13:15
Simple Python code failing with the 'secrettoken' variable
# Pasting the secret access token works at `pnutpy.api.add_authorization_token(secrettoken)`. HOWEVER I want to remove my access token from this code to ***allow sharing.***
import pnutpy
import console
tokenfile = open("secrettoken.txt", "r")
secrettoken = tokenfile.read()
# print secrettoken
pnutpy.api.add_authorization_token(secrettoken)
@bazbt3
bazbt3 / PnutMondayIDEAS.md
Last active April 8, 2017 07:28
Odd ideas for the 1st pnut.io #ThemeMonday

#PnutMondayIDEAS

(ASSUMING it gets picked for April 10th.)

  • some peanuts
  • pack of peanuts
  • peanut plant
  • peanut plant leaf
  • Peanuts cartoon character
  • retired political figures with peanut affiliations
  • peanut cuisine
@bazbt3
bazbt3 / rubyenvssuck.md
Created December 2, 2016 21:03
Ruby environment managers suck

A few days ago the Felix iOS app's push server finally went dark, so I decided I needed to really accelerate my computing hobby. There's no way I'll ever be able to produce as polished an app as Felix was, but I have urges which have lain dormant for 30 years. Or are they itches?

The time was right to install a command line client for App.net on my venerable Lappy486. Maybe an odd choice for a first step given the above? I've attempted to rationalise it by guessing the command line gets me closer to the action than a swipe or a tap - may help me understand an app's 'mechanics' more.

As far as I know there are 2 clients available:

  1. Ayadn by ADN's @ericd - at http://www.ayadn-app.net/
  2. Texapp by ADN's @doctorlinguist (Floodgap Software) - at http://www.floodgap.com/software/texapp/ - incidentally the maintainer of the very excellent TenFourFox browser for older Macs - at http://www.floodgap.com/software/tenfourfox/

I make the decision to install Ayadn because it looks the prettiest, the installation ins

@bazbt3
bazbt3 / ADN_Wiki_refining.md
Last active January 26, 2016 06:32
Refining the App.net Wiki: Ideas

Triaging:

What, why:

There are a lot of effectively obsolete pages at the App.net Wiki - http://appdotnetwiki.net/ - some in need of explicit instructions for new viewers, others requiring edits to bring them up-to-date.

How:

I'm never ever in favour of deletions, hate broken links; we should simply work around them. But that's only my opinion.

@bazbt3
bazbt3 / Adventure-map.pdf
Last active February 27, 2016 20:19
Adventure
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bazbt3
bazbt3 / refresh_Tmux_windows_2
Created November 8, 2014 16:11
I want to refresh all windows & panes in a Tmux session. Stumped. (Followup.)
In essence I want a shell script menu option to refresh Tmux windows & panes.
(There is no user tmux.conf file - I use Tmuxinator to setup Tmux {it's easier} - thus it's not going to be as easy as this Linux noob thinks!)
I have 3 files (none yet in a public repo):
1. ~/Documents/ayadn_run.sh - calls up a Tmuxinator file,
2. ~/.tmuxinator/ayadn.yml - which starts a Tmux session and in turn calls up
3. ~/Documents/ayadn_shell.sh - the shell script menu running inside the Tmux session.
ayadn_shell.sh:
@bazbt3
bazbt3 / refresh_Tmux_windows
Created November 6, 2014 12:54
I want to refresh all windows & panes in a Tmux session. Stumped.
# ~/Documents/ayadn_shell.sh
#
# I want to refresh all windows & panes running in the currently-running Tmux session.
# I'm not Linux- or Tmux- literate (2 weeks in.)
#
# Menu option (item 8, not implemented) in the partial code below doesn't work.
# I intended this code to close Tmux and then re-open it - mirroring the manual method I use currently.
#
# "Tmux kill-session" exits to the command line
# "mux ayadn" starts Tmuxinator and sets up a Tmux session using ~/.tmuxinator/ayadn.yml