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 |
[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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
Similar to ansible
command but allows you to use any command that will work in your shell. Not tied to specific configuration management tooling, just SSH and your default shell on remote systems. Just works. I <3 it :)
Runs commands across potentially many machines. Allows you to organize your servers/VMs/instances into groups very easily.
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
#!/usr/bin/env ruby | |
# | |
# stevie_chambers@viewyonder.com July 2012 | |
# | |
# I'm playing around with APIs, and sharing my learnings | |
# You can follow my trials and tribulations at http://viewyonder.com/apis | |
# | |
# This is a simple Ruby script to show how a simple API might work. | |
# The resource model is just a simple array of a single class - no back-end store (yet) | |
# |
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
var connectionString = 'postgres://localhost:5432/postgres'; | |
var Promise=require('bluebird'); | |
var knex = require('knex')({ | |
client: 'pg', | |
connection: { | |
user: 'postgres', | |
database: 'postgres', | |
port: 5432, |
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
tell application "System Events" | |
# create an iTerm session if we dont have one | |
if not (exists (processes where name is "iTerm")) then | |
tell application "iTerm" to (make new terminal) | |
end if | |
tell application "iTerm" | |
activate | |
tell the current terminal | |
set SublimeSessionName to "sublime" |
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
" Requirements: | |
" - you'll need VIM compiled with Ruby scripting support | |
" - example: for Debian/Ubuntu: sudo apt-get install vim-ruby | |
" - please, copy this file to one of your VIM dir | |
" - example: to your .vim home folder: $HOME/.vim/vimlog.vim | |
" - please, add this code to your .vimrc file: | |
" | |
" if !exists('*Wordpress_vim') | |
" runtime vimlog.vim | |
" endif |
NewerOlder