Skip to content

Instantly share code, notes, and snippets.

View brock's full-sized avatar
😎

Brock Angelo brock

😎
View GitHub Profile
@brock
brock / markdown-details-collapsible.md
Created July 17, 2019 19:48 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.

A collapsible section with markdown

Click to expand!

Heading

  1. A numbered
  2. list
    • With some
    • Sub bullets
@brock
brock / __init__.py
Created December 26, 2018 15:50 — forked from theorm/__init__.py
Pluggable API using Flask MethodView.
# -*- 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__ = [
@brock
brock / extract_exceptions.py
Created September 4, 2018 15:05 — forked from originell/extract_exceptions.py
Python Traceback Extractor from text/log files.
"""
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
@brock
brock / json_postgres.js
Created October 14, 2015 14:52 — forked from lucdew/json_postgres.js
Example of json document storage in postgresql and querying (with knex.js)
var connectionString = 'postgres://localhost:5432/postgres';
var Promise=require('bluebird');
var knex = require('knex')({
client: 'pg',
connection: {
user: 'postgres',
database: 'postgres',
port: 5432,
#!/bin/sh
if [ $# -ne 2 ]
then
echo "Usage: $0 <postgresql sql dump> <db_name>" >&2
exit 1
fi
db_file=$1
db_name=$2
#!/usr/bin/env node
// Simply publish a message to a direct exchange.
sys = require('sys');
amqp = require('./amqp');
inspect = sys.inspect;
puts = sys.puts;
connection = amqp.createConnection();

[exec_sh] mLast updated: 2015-01-18

Searching for Files

###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

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>
L.Control.Button = L.Control.extend({
options: {
position: 'bottomleft'
},
initialize: function (options) {
this._button = {};
this.setButton(options);
},

A Backbone.js demo app (Sinatra Backend)

Oct 16 2010

Updates

  • 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments

In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].