This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set ignorecase | |
set smartcase | |
set scrolloff=3 " 3 lines above/below cursor when scrolling | |
" Emulated Plugins | |
set surround | |
" Copy to system clipboard as well | |
set clipboard+=unnamed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
from discord.ext import commands | |
import sys, traceback | |
"""This is a multi file example showcasing many features of the command extension and the use of cogs. | |
These are examples only and are not intended to be used as a fully functioning bot. Rather they should give you a basic | |
understanding and platform for creating your own bot. | |
These examples make use of Python 3.6.2 and the rewrite version on the lib. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: yellow; icon-glyph: bicycle; | |
let stages = await loadStages() | |
let stage = findStage(stages) | |
if (stage == null) { | |
let widget = createTournamentOverWidget() | |
await widget.presentMedium() | |
} else { | |
let stageDetails = await loadStageDetails(stage.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Taken from | |
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types | |
and sorted. | |
Python's own `mimetypes.guess_extension` is pretty useless, eg. "text/plain" maps to the ".bat" extension. | |
""" | |
content_types = { | |
'application/epub+zip': '.epub', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
SILENT = ENV['SL_SILENT'] =~ /false/i ? false : true || true | |
VERSION = '2.2.19' | |
# SearchLink by Brett Terpstra 2015 <http://brettterpstra.com/projects/searchlink/> | |
# MIT License, please maintain attribution | |
require 'net/https' | |
require 'uri' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
This module provides a Python wrapper around CIImage and CIFilter for using CoreImage filters from Pythonista more easily. | |
How to use: | |
1) Create a CImage object. The constructor accepts either a file path, a ui.Image, PIL.Image.Image, or photos.Asset object. Example: | |
>>> # From a photo: | |
>>> img = CImage(photos.pick_asset()) | |
>>> # From a ui.Image: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quick workaround for photos module (Pythonista) not downloading photos from iCloud | |
import photos | |
from objc_util import ObjCClass, ObjCInstance, ObjCBlock | |
def download_cloud_asset(asset): | |
PHImageManager = ObjCClass('PHImageManager') | |
PHImageRequestOptions = ObjCClass('PHImageRequestOptions') | |
ph_asset = ObjCInstance(asset) | |
ph_image_mgr = PHImageManager.defaultManager() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from objc_util import * | |
import console | |
import urllib | |
import dialogs | |
WKWebView = ObjCClass('WKWebView') | |
UIViewController = ObjCClass('UIViewController') | |
UIBarButtonItem = ObjCClass('UIBarButtonItem') | |
NSURLRequest = ObjCClass('NSURLRequest') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import webbrowser | |
URL_BASE = "drafts://x-callback-url/create?" | |
CALLBACK_URL_BASE = "pythonista://" | |
def do_action(actiontype,txt,cb=CALLBACK_URL_BASE): | |
surl = URL_BASE + 'text=' + urllib.quote(txt) + '&action=' + urllib.quote(actiontype) + '&x-success=' + urllib.quote(cb) | |
webbrowser.open(surl) | |
print "Action Complete" | |
def message(txt,cb=CALLBACK_URL_BASE): | |
do_action('Message',txt,cb) |