Install flake8
$ pip install flake8`
Edit pre-commit file
$ vim .git/hooks/pre-commit`
to show and enforce styleguide conventions before commit, add the following:
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Meetup endpoints</title> | |
<ul></ul> | |
</head> | |
<body> |
var SPREADSHEET_ID = 'SHEET_ID_HERE'; | |
var SHEET_NAME = 'SHEET_NAME_HERE'; | |
function doGet() { | |
var range = SpreadsheetApp.openById(SPREADSHEET_ID).getSheetByName(SHEET_NAME).getDataRange(); | |
var json = JSON.stringify(range.getValues()); | |
return ContentService.createTextOutput(json).setMimeType(ContentService.MimeType.JAVASCRIPT); | |
} |
Install flake8
$ pip install flake8`
Edit pre-commit file
$ vim .git/hooks/pre-commit`
to show and enforce styleguide conventions before commit, add the following:
[{"plans": [{"specs": [{"disk": 3072, "dollars_per_hr": 0.01, "description": "1 vCPU (shared physical core) and 0.6 GB RAM", "dollars_per_mo": 6, "transfer": "unlimited?", "ram": 614, "id": "1000", "cpu": 1}], "name": "f1-micro", "id": "f1-micro"}, {"specs": [{"disk": 3072, "dollars_per_hr": 0.035, "description": "1 vCPU (shared physical core) and 1.7 GB RAM", "dollars_per_mo": 23, "transfer": "unlimited?", "ram": 1740, "id": "2000", "cpu": 1}], "name": "g1-small", "id": "g1-small"}, {"specs": [{"disk": 65536, "dollars_per_hr": 0.792, "description": "16 vCPUs, 14.4 GB RAM", "dollars_per_mo": 532, "transfer": "unlimited?", "ram": 14746, "id": "4016", "cpu": 16}], "name": "n1-highcpu-16", "id": "n1-highcpu-16"}, {"specs": [{"disk": 65536, "dollars_per_hr": 0.099, "description": "2 vCPUs, 1.8 GB RAM", "dollars_per_mo": 66, "transfer": "unlimited?", "ram": 1843, "id": "4002", "cpu": 2}], "name": "n1-highcpu-2", "id": "n1-highcpu-2"}, {"specs": [{"disk": 65536, "dollars_per_hr": 1.584, "description": "32 vCPUs, 28 |
#!/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 | |
# |
# Prevent nemo from creating a desktop window that shows icons | |
gsettings set org.nemo.desktop show-desktop-icons false |
# 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) |
# 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 \{\} \; |
#!/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 |
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 |