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 .bananas import Bananas | |
from .base import the_api | |
the_api.add_url_rule('/bananas', view_func=Bananas.as_view('bananas')) | |
the_api.add_url_rule('/farm/<farm_id>/bananas', view_func=Bananas.as_view('bananas_from_a_farm')) | |
__all__ = [ |
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
""" | |
Extract unique Python-Exceptions with their Traceback from a log/text file. | |
Usage:: | |
python extract_exceptions.py -f logfile.txt | |
Furthermore it supports excluding exceptions you don't want to have:: | |
python extract_exceptions.py -f logfile.txt -e ValueError,AttributeError |
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
// paste this into https://script.google.com | |
// setup a trigger to run on a schedule | |
// create a spreadsheet with these columns: | |
// "Tracking Code",Date,Time,Service,Carrier | |
var GOOGLE_SPREADSHEET_ID = "CHANGE_ME"; | |
function getFedExDeliveries() { | |
// get spreadsheet and tab | |
var ss = SpreadsheetApp.openById(GOOGLE_SPREADSHEET_ID); | |
var sheet = ss.getSheetByName('raw-data'); |
[exec_sh] mLast updated: 2015-01-18
###Find images in a directory that don't have a DateTimeOriginal###
exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .
###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs
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
#!/bin/bash | |
ALL=$(du -s | awk '{print $1}'); | |
NODEMODULES=$(find . -type d -depth 1 -name node_modules | xargs du -s | awk '{print $1}' | awk '{sum+=$1} END {print sum}'); | |
DECIMAL=$(awk "BEGIN {printf \"%.2f\", $NODEMODULES/$ALL}") | |
PERCENT=$(echo "$DECIMAL*100" | bc) | |
echo "node_modules are using $PERCENT% of space in the current directory." |
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
#!/bin/bash | |
# gru | |
# Git Remove Untracked (files) | |
# without this script, you have to manually delete files and directories in your git directory if | |
# you want to delete them and they are not tracked by git. | |
# this works as an alias or an executable file | |
# Explanation: | |
# git status -s (display the git status of each file, one line at a time, in short format) | |
# grep '^??' (untracked files will begin with ??) |
Inside of a file like index.scala.html, you may want to get or set variables between Scala and JavaScript. Here are some examples.
@test = { "something" }
@test = @{
- Be me
- forget the exact syntax for using rsync.
- get nested folders by mistake or end up with lots of files in the current directory
- sync files then delete files like 100 times as you try to remember the syntax
- look at the man page and then try again
- get nested folders by mistake or end up with lots of files in the current directory
- sync files then delete files like 100 times as you try to remember the syntax
- finally figure it out