trailer park party – june 2019 by arixant
// kodak dc240i zoom
if you ever find yourself in the position I’m in rn – having somehow managed to forget to make an important call *all day* – just a reminder that it’s actually incredibly easy to schedule an iPhone telephone call that will happen without any user intervention lol.
Sindre’s Awesome List
Sindre’s Awesome List
Contents
Platforms
Programming Languages
Front-End Development
Back-End Development
Computer Science
Big Data
Theory
Books
Editors
Gaming
Development Environment
Entertainment
Databases
Media
Learn
Security
Content Management Systems
Hardware
Business
Work
Networking
Decentralized Systems
Health and Social Science
Events
Testing
Miscellaneous
Related
Platforms
Node.js…
Cassinelli Feedback
Updated 10032022-171726
Shortcuts User Group Discord Message
Gist
Secret Gist
Drafts
WTF
Local
Simplenote Local
Things
—
Original Discord Message
GitHub Gist
WTF Documentation Page
—
https://gist.github.com/extratone/fed42b233266777d98d155faa7481548.js
https://gist.github.com/extratone/9dd2198ea08ff3c21c48a34d64e2c6d6.js
—
Unresolved
Personal Automations screen always lags when…
Command Line Tumblr
A Totally New Interface for Tumblr?
Today, Tumblr is accessible via mobile, web or api—but what if you’re a linux enthusiast? Nerds like you can now access Tumblr completely via command line.
“What about images?” you ask. Displaying an image in command line is not something new. There are already a bunch of existing libs doing this, namely aalib, libcaca and super low level ncurses. And the most interesting project built based on those—p2p video chat—comes from a hackathon.
I picked up a much higher level library called blessed, for least efforts to achieve a best looking interface. As you may seen, blessed is javascript-based and very fancy. It provides you with almost every widget you might need to build an awesome dashboard.
Most of the work has already been done after figuring out the right library, to show tumblr in command line, we just need to
- Connect the api to fetch image urls.
- Do some front-end design to show a Tumblrish dashboard.
What? Still need codes?…
var post = blessed.box({ parent: dashboard, top: '15%', left: 'center', width: '40%', height: '80%', draggable: true, border: { type: 'line' }, style: { fg: 'white', bg: 'white', border: { fg: '#f0f0f0' } }, }); var load_post = function() { if (index < 0 || index >= posts.length) return; post.free(); var post_data = posts[index]; /** avator */ blessed.ANSIImage({ parent: post, top: 0, left: '-30%', width: '20%', height: '20%', file: post_data.avator, }); /** posts */ var count = post_data.count; // TODO: switch all sizes for (var i = 0; i < count; i++) { var offset = 100/count * i; var width = 100/count; blessed.ANSIImage({ parent: post, left: offset + '%', width: width + '%', height: '98%', file: post_data.data[i] }); } screen.render(); }Blessed already provided lots of high level apis. As an example, to display a post as an image, all your input is just an image url, and call
blessed.ASNImage({ ... file: image_url/local_file })It supports png and gif, and even, if you’d like to show a video, blessed also provides video. Hypothetically speaking, we can use this library to build almost all components in the dashboard of Tumblr today. Note, it’s not connecting the real api, but I suppose that would be pretty easy. Also there’s a memory optimization issue might need to be addressed if we really want to use this library for something.
tumblr.js update
We just published v1.1.0 of the tumblr.js API client. We didn’t make too much of a fuss when we released a bigger update in May, but here’s a quick run-down of the bigger updates you may have missed if you haven’t looked at the JS client in a while:
- Method names on the API are named more consistently. For example,
blogInfo
andblogPosts
andblogFollowers
rather thanblogInfo
andposts
andfollowers
.- Customizable API
baseUrl
. We use this internally when we’re testing new API features during development, and it’s super convenient.data64
support, which is handy for those times when you have a base64-encoded image just lying around and you want to post it to Tumblr.- Support for
Promise
objects. It’s way more convenient, if you ask me. Regular callbacks are still supported too.- Linting! We’ve been using
eslint
internally for a while, so we decided to go for it here too. We’re linting in addition to runningmocha
tests on pull requests.Check it out on GitHub and/or npm and star it, if you feel so inclined.
tumblr.js REPL
When we were updating the API client, we were pleasantly suprised to discover a REPL in the codebase. If you don’t know, that’s basically a command-line console that you can use to make API requests and examine the responses. We dusted it off and decided to give it its own repository. It’s also on npm.
If you’re interested in exploring the Tumblr API, but don’t have a particular project in mind yet, it’s a great way to get your feet wet. Try it out!
Columbia Local Bot
Updated 10032022-004638
GitHub Issue
GitHub Wiki Page
Telegram Link
Alternate Telegram Link
Announcement message
r/columbiamo Subreddit Autoposting Poll
WTF
WTF Shortlink – https://davidblue.wtf/columbiamobot
Repository File
Telegraph
Backup
Things
Social
Howdy, folks!
This is a semi-formal announcement, I suppose.
I’ve created a very simple Telegram…
How to Update all Python Packages with a Single pip Command
Ensure all present Python packages on Windows and Linux systems are parallel with their latest available versions from the command line.
With Python, the best practice of pinning all the packages in an environment at a specific version ensures that the environment can be reproduced months or even years later.
- Pinned packages in a requirements.txt file are denoted by ==. For example, requests==2.21.0. Pinned packages should never be updated except for a very good reason, such as to fix a critical bug or vulnerability.
- Conversely, unpinned packages are typically denoted by >=, which indicates that the package can be replaced by a later version. Unpinned packages are more common in development environments, where the latest version can offer bug fixes, security patches and even new functionality.
As packages age, many of them are likely to have vulnerabilities and bugs logged against them. In order to maintain the security and performance of your application, you’ll need to update these packages to a newer version that fixes the issue.
The pip package manager can be used to update one or more packages system-wide. However, if your deployment is located in a virtual environment, you should use the Pipenv package manager to update all Python packages.
NOTE: be aware that upgrading packages can break your environment by installing incompatible dependencies. This is because pip and pipenv do not resolve dependencies.
Python Package Upgrade Checklist
In general, you can use the following steps to perform a package upgrade:
- Check that Python is installed
Before packages can be updated, ensure that a Python installation containing the necessary files needed for updating packages is in place by following the steps outlined in “[Using Python on Windows]” in the official documentation.
- Get a list of all the outdated packages
To generate a list of all outdated packages:
pip list –outdated
- Upgrade outdated packages
Depending on your operating system or virtual environment, refer to the following sections.
The easiest way to update all packages in a Windows environment is to use pip in conjunction with Windows PowerShell:
- Open a command shell by typing powershell in the Search Box of the Task bar
- Enter:
pip freeze | %{$_.split(’==’)[0]} | %{pip install –upgrade $_}
This will upgrade all packages system-wide to the latest version available in the Python Package Index (PyPI).
Update all Python Packages on Linux
Linux provides a number of ways to use pip in order to upgrade Python packages, including grep and awk.
To upgrade all packages using pip with grep on Ubuntu Linux:
pip3 list –outdated –format=freeze | grep -v ’^-e’ | cut -d = -f 1 | xargs -n1 pip3 install -U
To upgrade all packages using pip with awk on Ubuntu Linux:
pip3 list -o | cut -f1 -d’ ’ | tr “ ” “n” | awk ’{if(NR>=3)print)’ | cut -d’ ’ -f1 | xargs -n1 pip3 install -U
Updating Python Packages on Windows or Linux
Pip can be used to upgrade all packages on either Windows or Linux:
- Output a list of installed packages into a requirements file (requirements.txt):
pip freeze > requirements.txt
- Edit requirements.txt, and replace all == with >=. Use the Replace All command in the editor.
- Upgrade all outdated packages:
pip install -r requirements.txt –upgrade
Updating all Packages in a Virtual Environment
The easiest way to update unpinned packages (i.e., packages that do not require a specific version) in a virtual environment is to run the following Python script that makes use of pip:
import pkg_resources from subprocess import call for dist in pkg_resources.working_set: call(“python -m pip install –upgrade ” + dist.<projectname>, shell=True)
Updating all Packages in a Pipenv Environment
The simplest way to update all the unpinned packages in a specific virtual environment created with pipenv is to do the following steps:
- Activate the Pipenv shell that contains the packages to be upgraded:
pipenv shell pipenv update
How to Update All Python Packages
How to Update All Python Packages
How to Update All Python Packages
Archive
pip Update Shortcut
MediumShell Commands
pip list –outdated
pip freeze | %{$_.split(’==’)[0]} | %{pip install –upgrade $_}
pip3 list –outdated –format=freeze | grep -v ’^-e’ | cut -d = -f 1 | xargs -n1 pip3 install -U
pip3 list -o | cut -f1 -d’ ’ | tr “ ” “n” | awk ’{if(NR>=3)print)’ | cut -d’ ’ -f1 | xargs -n1 pip3 install -U
pip freeze >…
Episode 149 – Shortcuts for iPadOS 16 with Matthew Cassinelli (Part 1)
Episode 149 – Shortcuts for iPadOS 16 with Matthew Cassinelli (Part 1)
Convert TextExpander Snippets to iOS/OS X Text Shortcuts
mosx:
TextExpander Snippets to iOS/OS X Text Shortcuts
Here is something I’ve been working on for quite a while now. I first had the idea for this when I went to Vienna. I was annoyed that Apple still didn’t allow TextExpander to do what I love it to do. Three weeks ago it looked bad for TextExpander already, now, a couple of weeks later, it looks even worse.
Since Mavericks, Text Shortcuts (System Preferences → Keyboard → Text) sync with iOS devices. I started thinking how to automate adding new shortcuts by script. Scripting the UI is, obviously and technically, my least favorite option, but it’s what I ended up doing.
If you are interested in the technical difficulties that I had to overcome, which make this script work the way it does, read on. Otherwise head to the end to download.
How OS X Text Shortcuts Work
When a new Text Shortcut gets added in the System Preference pane Keyboard → Text, OS X does a couple of things.
First it saves a “receipt” of this addition/removal to
~/Library/Mobile Documents/com~apple~TextInput/
in there are a couple of folders. Most important are those with your username. Open that folder and you seeUserDictionary
with a subfolder. Select the ones with “~
” in their name.Every time you add or remove a new shortcut a zipped plist will be saved here, containing an Epoch timestamp, the shortcut and the phrase (as Apple calls expansions). Some other data is in the plist as well, but the important bits are the ones I just described.
The other important folder is in
~/Library/Dictionaries/CoreDataUbiquitySupport
. This folder looks similar. It contains two folders, somewhere you will find aUserDictionary.db
file. This is a SQLite database.When a new shortcut gets added, a new row will be created here. Again Epoch timestamp, shortcut, and phrase are the important pieces.
What Does Not Work
My first guess was to add new “receipt” files to
Mobile Documents
. I was hoping that OS X would realize there’s a new file, read it and add it to OS X Text Shortcuts, and that this would also transfer new shortcuts to an iOS device. It does not.
Adding new files here with a similar structure does not update the System Preference pane Table View, nor does it make an iOS device recognize the addition.I started tinkering with SQLite then. The SQLite database in
Dictionaries
is only used to feed the Table View displayed in System Preferences. Add new rows here with a similar structure, restart System Preferences, and you will see the new shortcut. Editing the database files does not trigger iCloud to sync shortcuts.At this point I was pretty disappointed and took my least favorite route, UI scripting. I know it’s hacky, I know it’s dirty, I know all that, but scripting the UI lead to a working solution.
Maybe looking a bit more intoMobile Documents
would eventually have resulted in a better solution. I weighed the time it would take me to figure this out against the time it takes me to make a first running version. I prefer things to be done.How This Script Works
PLEASE READ THIS, IT IS IMPORTANT! ALL YOUR EXISTING SHORTCUTS WILL GO POOF!
- Open System Preferences → Keyboard → Text
- Click the Table View, select all, press backspace. This deletes all existing shortcuts and takes a moment or two.
- Turn off TextExpander text expansion. This is important. Otherwise when the script types the phrase, TextExpander would expand the abbreviation.
- It will then compile a list of all your TextExpander snippets.
- The script will then click +, type out the abbreviation, ⇥ to the next cell, paste the expansion from the clipboard, press return.
- After it has completed typing all shortcuts, TextExpander text expansion will be turned back on.
A few things to note:
- As the script automates the UI, just sit and watch. It takes about 4:40 minutes to type in about 300 snippets.
- The clipboard is used, because this way the expansion can have multiple lines.
- This script is smart enough not to process any dynamic snippets. Dynamic snippets use date calculations, Fill-Ins, and any script snippets.
- It takes a while for the list of snippets to be compiled. If AppleScript Editor says “Running…” at the bottom, the script is still running.
- If you hear an error beep you may have luck running the script again. Sorry this happens sometimes, I couldn’t figure out why.
- Set all snippet groups that you don’t want to be added in
disallowedGroups
. The name must match the snippet group’s name.If you want to know how many snippets you have, comment out the part where the script starts adding all Text Shortcuts. There is a line
log "Count of abbreviationList: " & (count of abbreviationList)
After this insert
(*
, and*)
way at the end.Download
Oh my god… I (and others I know) have been somewhat desperately searching for this very solution for like 18 months now lol.
best iOS/iPadOS Shortcuts idea I’ve had since release, I think. about as simple as it gets hehe.