Skip to content

Instantly share code, notes, and snippets.

View extratone's full-sized avatar
🗿
iOS Keyboard Shortcuts and E D I T O R I A L G I T , BITCH!

David Blue extratone

🗿
iOS Keyboard Shortcuts and E D I T O R I A L G I T , BITCH!
View GitHub Profile
@extratone
extratone / rst_to_md.sh
Created May 27, 2024 13:12 — forked from zaiste/rst_to_md.sh
Convert RST to Markdown using Pandoc
FILES=*.rst
for f in $FILES
do
filename="${f%.*}"
echo "Converting $f to $filename.md"
`pandoc $f -f rst -t markdown -o $filename.md`
done
@extratone
extratone / settings.json
Created May 3, 2024 07:34 — forked from 3nws/settings.json
Zed config
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
"base_keymap": "VSCode",
@extratone
extratone / path.md
Created May 2, 2024 05:43 — forked from nex3/path.md

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and
@extratone
extratone / 0dedict.py
Created April 28, 2024 14:07 — forked from josephg/0dedict.py
Apple dictionaries
# Thanks to commenters for providing the base of this much nicer implementation!
# Save and run with $ python 0dedict.py
# You may need to hunt down the dictionary files yourself and change the awful path string below.
# This works for me on MacOS 10.14 Mohave
from struct import unpack
from zlib import decompress
import re
filename = '/System/Library/Assets/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/9f5862030e8f00af171924ebbc23ebfd6e91af78.asset/AssetData/Oxford Dictionary of English.dictionary/Contents/Resources/Body.data'
f = open(filename, 'rb')
.sri-group,
.search-result,
.scene {
background-color: #1e2028;
border-radius: 12px;
}
.scene {
padding: 1rem;
}
@extratone
extratone / debian.sh
Created January 12, 2024 21:11 — forked from titulus/debian.sh
debian
#nodejs
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - && sudo apt-get install -y nodejs
#mongodb
sudo apt-get install dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 \
&& echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list \
&& sudo apt-get update && sudo apt-get install -y mongodb-org \
&& sudo service mongod start && sudo systemctl enable mongod.service
@extratone
extratone / url-regex-tutorial.md
Created November 29, 2023 06:52 — forked from mambru82/url-regex-tutorial.md
regex tutorial for URL matching

Matching a URL using regular expressions - a tutorial

The following gist gives a thorough description of the central components in matching a given URL utilizing regular expressions in Javascript.

Summary

Regex uses a sequence of characters to define a specific search pattern. In the URL matching regex, regex matches any valid URL.

/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/
@extratone
extratone / return1Writer.js
Created November 29, 2023 01:12 — forked from philgruneich/return1Writer.js
Returns to 1Writer and replaces the selection with a Markdown link from the Safari page.
javascript:window.location='onewriter://x-callback-url/replace-selection?text='+encodeURIComponent('%5B%5D('+location.href+'%20%5C''+document.title+'%5C')')
@extratone
extratone / remove-emoji.py
Created November 12, 2023 13:08 — forked from slowkow/remove-emoji.py
Remove all traces of emoji from a text file.
#!/usr/bin/env python
"""
Remove emoji from a text file and print it to stdout.
Usage
-----
python remove-emoji.py input.txt > output.txt
"""
@extratone
extratone / grabicon.rb
Created November 3, 2023 05:06 — forked from ttscoff/grabicon.rb
Grab an iOS or Mac app icon from local version or iTunes search
#!/usr/bin/env ruby -W1
# frozen_string_literal: true
# Mac only
#
# Usage: grabicon.rb SEARCH TERMS [%[small|medium|large] [@[mac|ios|iphone|ipad]]
# If the search terms match a local app, that app's icon will be extracted and converted to PNG
# If the search terms don't match a local app, iTunes will be searched
# If the search terms end with "@mac", "@iphone", "@ipad", or "@ios", iTunes will be searched for a match
# If the search terms end with "%large", "%medium", "%small", or "%XXX" icon will be scaled to size