Skip to content

Instantly share code, notes, and snippets.

Last updated: 2015-08-11

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

# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway:
@markcheno
markcheno / pg-pong.py
Created March 25, 2017 21:01 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@markcheno
markcheno / snakecoin-server-full-code.py
Created September 19, 2017 00:52 — forked from aunyks/snakecoin-server-full-code.py
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block:
@markcheno
markcheno / nice-scale.js
Created February 14, 2018 03:52 — forked from igodorogea/nice-scale.js
Javascript - Algorithm for Optimal Scaling on a Chart Axis (Nice Numbers for Graph Labels)
function NiceScale (lowerBound, upperBound, _maxTicks) {
var maxTicks = _maxTicks || 10;
var tickSpacing;
var range;
var niceLowerBound;
var niceUpperBound;
calculate();
@markcheno
markcheno / AppSyncAPI.yaml
Created August 4, 2018 15:39 — forked from adrianhall/AppSyncAPI.yaml
A CloudFormation template for DynamoDB + Cognito User Pool + AppSync API for the Notes tutorial
---
Description: AWS AppSync Notes API
Parameters:
APIName:
Type: String
Description: Name of the API - used to generate unique names for resources
MinLength: 3
MaxLength: 20
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$'
@markcheno
markcheno / AppSync-Example.yaml
Created August 5, 2018 15:57 — forked from adrianhall/AppSync-Example.yaml
An example CloudFormation template for AWS AppSync
---
Description: AWSAppSync DynamoDB Example
Resources:
GraphQLApi:
Type: "AWS::AppSync::GraphQLApi"
Properties:
Name: AWSAppSync DynamoDB Example
AuthenticationType: AWS_IAM
PostDynamoDBTableDataSource:
@markcheno
markcheno / ohlc.chart.js
Created September 13, 2018 02:04 — forked from thiyagu-p/ohlc.chart.js
OHLC with moving average and trading volume chart using d3
function OHLC(params) {
OHLC.prototype._init = function (params) {
this.height = params.height || 650;
this.width = params.width || 1300;
this.margin = params.margin || 50;
this.data = params.data;
this.movingAverageTypes = ['mov_avg_10d', 'mov_avg_50d', 'mov_avg_200d'];
this.dateFormat = d3.time.format("%Y-%m-%d");
@markcheno
markcheno / index.haml
Created September 13, 2018 02:51
React Chips component
%h2#title React Chips!
#react-mount
@markcheno
markcheno / .crostini-setup
Created September 16, 2018 14:57 — forked from tjpalanca/.crostini-setup
Crostini Setup
These scripts set up Crostini on my Pixelbook