Skip to content

Instantly share code, notes, and snippets.

@jeffgodwyll
jeffgodwyll / gistbox test
Created May 7, 2013 12:19
testing this new chrome app
Yeah it works + is awesomely cool (for 1st text test)
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@jeffgodwyll
jeffgodwyll / App Engine FAQ's
Last active December 21, 2015 11:39
Applications listeners should have on their machines + downloadable linksServices listeners should sign up for.
Conclusion & Review
Q: What cloud service level does Google App Engine sit?
A: App Engine is a platform (PaaS) service.
Q: What do you need in order to get started playing with Google App Engine?
A: You need to get the SDK from Google. Use this downloads link to get the one for your platform. The SDK comes with client libraries which you'll use to connect to the various App Engine APIs, a set of command-line tools for administration, and a development server. Mac and PC users also get a bonus: a GUI called the "Launcher" that gives a friendly interface to users and provides access to a subset of the command-line tool functionality.

Keybase proof

I hereby claim:

  • I am jeffgodwyll on github.
  • I am jeffgodwyll (https://keybase.io/jeffgodwyll) on keybase.
  • I have a public key whose fingerprint is 740E 80A5 3CA1 2B97 2389 2820 0C2C 7BDD 8790 843B

To claim this, I am signing this object:

@jeffgodwyll
jeffgodwyll / urlexists.py
Last active August 29, 2015 14:10
Test for valid url before scraping
import requests
def url_exists(url):
response = requests.get(url)
return response.status_code == requests.codes.ok
url_exists('http://google.com') #True: exists
url_exists('http://jeffgodwyll.com/ht.m') #False: doesn't exist
#!/usr/bin/python
'''
Convert Blogger xml-exported file to markdown
Primarily from https://gist.github.com/larsks/4022537 with some modifications
'''
import os
import sys
import argparse
import iso8601
import re
@jeffgodwyll
jeffgodwyll / recursive_x_mod
Created March 2, 2015 23:42
When I move my android sdk folder onto an NTFS disk, I tend to loose the executable bit. This is to remedy the situation a whole lot better.
# Run in project root
# Recursively add executable bit to all files without a dot filename
find -type f -not -name "*.*" -exec chmod +x \{\} \;
# Recursively add exec bit to all files with .so in filename
find -type f -name "*.so*" -exec chmod +x \{\} \;
# Recursively add exec bit to all files with .so in filename
find -type f -name "*.jar*" -exec chmod +x \{\} \;
# Snippet 1
###########
# Copy the build folder(containing the html files) to a folder in flask's static
# directory and serve this way:
@app.route('/<dir>/<filename>', defaults={'static': True})
def build_dir(dir='',filename='index.html'):
path = join(dir,filename)
return app.send_static_file(path)
# Prevent nemo from creating a desktop window that shows icons
gsettings set org.nemo.desktop show-desktop-icons false
@jeffgodwyll
jeffgodwyll / refresh_token.py
Created June 19, 2016 01:29
To generate refresh token to use with Google API's for user data
#!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#