Skip to content

Instantly share code, notes, and snippets.

@yanofsky
yanofsky / LICENSE
Last active Jul 21, 2021
A script to download all of a user's tweets into a csv
View LICENSE
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
View beautiful_idiomatic_python.md

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!

View gist.py
import httplib
import urllib
import re
import os.path
def gist_write(name, content, ext=None, login=None, token=None):
if ext is None:
ext = os.path.splitext(name)[1]
View arcpy_merge_paths.py
def connect_parts(fc):
"""
Takes each part of a line feature. If made of more than one path
(aka segment, aka part) connects them into a single path.
Vertices are unchanged.
Code authored on ArcGIS ver 10.2.2
"""
import json
with arcpy.da.UpdateCursor(fc, "Shape@JSON") as uc:
@jasonsalas
jasonsalas / app.yaml
Created Feb 19, 2015
OAuth2 consumer for App Engine to access Pushbullet's API
View app.yaml
application: YOUR_APP_NAME_HERE
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: oauth.application