Skip to content

Instantly share code, notes, and snippets.

View kleerkoat's full-sized avatar

kleerkoat kleerkoat

View GitHub Profile
@omz
omz / Dropbox File Picker.py
Last active February 20, 2025 09:40
Dropbox File Picker.py
# IMPORTANT SETUP INSTRUCTIONS:
#
# 1. Go to http://www.dropbox.com/developers/apps (log in if necessary)
# 2. Select "Create App"
# 3. Select the following settings:
# * "Dropbox API app"
# * "Files and datastores"
# * "(No) My app needs access to files already on Dropbox"
# * "All file types"
# * (Choose any app name)
@judithdrive
judithdrive / clipto.js
Last active February 20, 2025 09:41 — forked from technocrat/clipslate.py
Clipslate.py adapted for Editorial.
javascript:
(function (t,r) {
window.location = 'pythonista://clipto?action=run&argv=' + encodeURIComponent(document.title) + '&argv=' + encodeURIComponent(location.href) + '&argv=' + t + '&argv=' + r + '&argv=' + encodeURIComponent(document.getSelection()||'');
})('Sublime','Dropbox')
@omz
omz / FontInstaller.py
Last active January 31, 2025 20:34
FontInstaller
# FontInstaller (by @olemoritz)
# This script installs a custom TTF font on iOS (system-wide).
# It can be used in one of two ways:
# 1. Simply run it in Pythonista, you'll be prompted for the URL of the font
# you'd like to install (if there's a URL in the clipboard, it'll be used by default)
# 2. Use it as an 'Open in...' handler, i.e. select this file in Pythonista's 'Open in...
# menu' setting. This way, you can simply download a ttf file in Safari and open it in
/**
* 中缀表达式转后缀表达式
*/
function isOperator (item) {
return item === '+' || item === '-' || item === '*' || item === '/' || item === '(' || item === ')';
}
function convert (str) {
var output = [],
stack = [],
operator;
@Chrissy
Chrissy / RG_CSS_Style_Guide.scss
Last active August 29, 2015 13:57
Rap Genius CSS Style Guide
// css style guide
// welcome to the rap genius style guide!
// here you will find good rules of thumb when writing css and sass.
// of course: the only rule that really matters is:
.do-whatever { content: "it's just CSS!" }
// http://stackoverflow.com/questions/10425287/convert-string-to-camelcase-with-regular-expression
// fetch me my camel, Jeeves
var toCamelCase function (str) {
return str.toLowerCase().replace(/-(.)/g, function(match, group1) {
return group1.toUpperCase();
});
}
@philgruneich
philgruneich / commas_mmdtable.py
Last active March 18, 2018 13:17
Scripts to simplify the syntax for MultiMarkdown tables.
import re
table = '''First Header,Second Header,Third Header
1st Item,2nd\,Item,3rd Item
,One cell,Two cells
Two cells,One cell,
Awesome'''
ttable = [[re.sub('\\\,',',',cell) for cell in re.split('(?<!\\\),', row)] for row in table.split('\n')]
@mremond
mremond / boxcar_push.php
Created February 6, 2014 11:36
Send a Boxcar notification to your device in PHP
<?php
curl_setopt_array(
$chpush = curl_init(),
array(
CURLOPT_URL => "https://new.boxcar.io/api/notifications",
CURLOPT_POSTFIELDS => array(
"user_credentials" => 'ACCESS_TOKEN',
"notification[title]" => 'message title',
"notification[long_message]" => '<b>Some text or HTML for the full layout page notification</b>',
@omz
omz / ShowLastPhotoMap.py
Last active March 21, 2019 16:04
ShowLastPhotoMap
# Shows the location of the last photo in the canera roll in the Maps app.
# (thanks to @HyShai for pointing out that the latitude/longitude refs are necessary)
import photos
import webbrowser
meta = photos.get_metadata(-1)
gps = meta.get('{GPS}')
if gps:
latitude = str(gps.get('Latitude', 0.0)) + gps.get('LatitudeRef', '')
# -*- coding: utf-8 -*-
# Conway's game of life.
# Touch cells to give them life.
# Tap screen with two fingers to pause/un-pause.
# Tap screen with three fingers to give life to random cells.
from scene import *
from PIL import Image, ImageDraw
import random