Skip to content

Instantly share code, notes, and snippets.

View danlamanna's full-sized avatar
🏠
Working from home

Dan LaManna danlamanna

🏠
Working from home
View GitHub Profile
@danlamanna
danlamanna / create-gh-pr.sh
Last active February 16, 2021 16:55
Create and merge a GH PR automatically
#!/usr/bin/env bash
set -euo pipefail
MERGE_WHEN_CHECKS_PASS=0
VIEW_IN_WEB=0
if ! [ -x "$(command -v gh)" ]; then
echo 'Error: gh is not installed.' >&2
exit 1
fi
@danlamanna
danlamanna / fabfile.py
Created May 11, 2012 10:50
Fabric Pull Database
from fabric.api import *
from fabric.context_managers import hide
from fabric.operations import local, put, prompt, get
from time import time
import json
import os
import re
import sys
from string import strip
@danlamanna
danlamanna / imperial_spider.py
Created June 5, 2012 18:51
Scrapy crawling, pyEnchant spell checking.
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from spellchecker.items import SpellcheckItem
from BeautifulSoup import BeautifulSoup
import re,urllib,enchant
from string import strip
@danlamanna
danlamanna / gist:1325012
Created October 29, 2011 20:07
Making a custom pod widget
<?php
add_action('widgets_init', 'pods_register_widgets');
/**
* Register any/all pods widgets with wordpress.
*/
function pods_register_widgets() {
register_widget('Pods_Custom_Widget');
}
@danlamanna
danlamanna / doc.md
Last active August 2, 2019 13:36
ingesting activities into stumpf

The way to ingest activities is to take the relevant json files from the m1-annotations repo and run a python script over them that uploads them to Stumpf.

To set this up on your machine you need a few things:

  • Python and pip (if running the command 'pip' or 'python -m pip' prints the help page, you're good)

  • The m1-annotations repo
    Typically you'll want to be on the latest version of master without uncommitted changes, since the files are going from your computer to Stumpf.

Transactions: 15130 hits
Availability: 100.00 %
Elapsed time: 29.31 secs
Data transferred: 11.62 MB
Response time: 0.13 secs
Transaction rate: 516.21 trans/sec
Throughput: 0.40 MB/sec
Concurrency: 68.93
Successful transactions: 15130
Failed transactions: 0
@danlamanna
danlamanna / Dockerfile
Created February 27, 2018 17:52
building caffe and packaging with fpm
FROM ubuntu:14.04
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev \
libhdf5-serial-dev protobuf-compiler libatlas-base-dev python-dev cmake git \
autotools-dev automake && apt-get install -y --no-install-recommends libboost-all-dev libboost-python1.55.0
RUN apt-get install -y python-pip
RUN pip install -U pip
RUN pip install numpy scikit-image protobuf
RUN apt-get install -y ruby ruby-dev gcc make
#!/bin/bash
set -e
. /usr/bin/virtualenvwrapper.sh
BASE_PATH="$HOME/projects/girder/prs"
GIRDER_GITHUB_URL="https://github.com/girder/girder"
readonly VENV_PREFIX="girder"
readonly PR="$1"
@danlamanna
danlamanna / SVN.py
Created November 19, 2011 22:45
Sublime Text 2 - SVN Plugin
import sublime, sublime_plugin
import os, commands
import json, re
import pprint
""" TODO:
- have settings file with username/password/additional flags?
- options menu, per file/folder commands
<Taylors1Swiftie> Picture: Brightness - 45, Contrast - 50, LBL - 0,
Blur Reduc - off, Color Temp - user mode
<Taylors1Swiftie> Pic Advanced: Pic MOde - standard, Display Mode -
Full, Smart Focus Size - off
<Taylors1Swiftie> user mode colors - 96R, 96G,97B
<Taylors1Swiftie> Picture: Reset Color - no, AMA - high, Instant Mode
- on, Sharpness - 5, Gamma - gamma 3
> nvidia settings?
<Taylors1Swiftie> brightness 50 contrast 50 gamma .8 digital vibrance
50 hue 0