Skip to content

Instantly share code, notes, and snippets.

@schl3ck
schl3ck / Import Script from Gist.js
Last active February 29, 2024 07:22
Easily import Scriptable Scripts from Github Gists
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: yellow; icon-glyph: download;
// share-sheet-inputs: url;
/********************************************
* *
* Import Script from Gist *
* *
* This script imports files from a Github *
* Gist. *
@homecoder
homecoder / _tabview.py
Last active January 4, 2020 07:16
Pythonista TabView (Clone of iOS Tabbed Application)
# -*- coding: utf-8 -*-
"""
TabView - Clone of iOS Tabbed Application Bar
Copyright 2018 Michael Ruggiero
Released under MIT License - https://opensource.org/licenses/MIT
IMPORTANT: This was thrown together in tidbits of spare time while on my phone. It could definitely use a recfactor,
and as such, you may see some things which may not make sense, and/or aren't the greatest idea.
@0x4D31
0x4D31 / beautiful_idiomatic_python.md
Last active July 8, 2024 09:36 — forked from JeffPaine/beautiful_idiomatic_python.md
[Beautiful Idiomatic Python] Transforming Code into Beautiful, Idiomatic Python #python

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@balachandrana
balachandrana / redirect_console_output.py
Last active February 9, 2019 16:21
redirect_console_output.py
import ui
import sys
class TextViewFile(object):
def __init__(self, textview):
self.textview = textview
def write(self, msg):
self.textview.text += msg
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep -B6 bindings:.*:

Build a scalable Twitter clone with Django and GetStream.io

In this tutorial we are going to build a Twitter clone using Django and GetStream.io, a hosted API for newsfeed development.

We will show you how easy is to power your newsfeeds with GetStream.io. For brevity we leave out some basic Django-specific code and recommend you refer you to the Github project for the complete runnable source code. At the end of this tutorial we will have a Django app with a profile feed, a timeline feed, support for following users, hashtags and mentions.

I assume that you are familiar with Django. If you're new to Django the [official tutorial] (https://docs.djangoproject.com/en/2.0/intro/) explains it very well.

@omz
omz / FileTransfer.py
Last active June 23, 2024 14:50
File Transfer script for Pythonista (iOS)
# File Transfer for Pythonista
# ============================
# This script allows you to transfer Python files from
# and to Pythonista via local Wifi.
# It starts a basic HTTP server that you can access
# as a web page from your browser.
# When you upload a file that already exists, it is
# renamed automatically.
# From Pythonista's settings, you can add this script
# to the actions menu of the editor for quick access.
@kopischke
kopischke / markdown2evernote.rb
Created June 5, 2011 16:57
OS X service scripts
#!/usr/bin/env ruby -wKU
# Adapted from Brett Terpstra’s original “Markdown to Evernote” service (http://brettterpstra.com/a-better-os-x-system-service-for-evernote-notes-with-multimarkdown/)
# Martin Kopischke 2011 – License: Creative Commons Attribution Share-Alike (CC BY-SA) 3.0 Unported (http://creativecommons.org/licenses/by-sa/3.0/)
# Changes: – create only one Evernote note per (Multi)Markdown input passed (instead of one per line)
# – do not choke on shell escape characters (use Tempfile instead of shell pipe for osascript)
# – default to MultiMarkdown 3 executable (instead of MMD 2 Perl script)
# – make smart typography processing optional (set SMARTY to 'false' to bypass processing;
# note smart typography cannot be disabled in MMD 3.0 and 3.0.1
# – handle both smart typography processing scripts (ie. SmartyPants.pl)