Skip to content

Instantly share code, notes, and snippets.

View jacobsalmela's full-sized avatar
:octocat:
To all that makes us unique

Jacob Salmela jacobsalmela

:octocat:
To all that makes us unique
View GitHub Profile
@nd-net
nd-net / oct-and-tag.py
Created November 23, 2015 18:49
Does an OCR pass over a passed in PDF file and then tries to tag it using fuzzy search
#!/usr/local/bin/python3
tags = {
"Rechnung": "Rechnung",
"Beleg": "Rechnung"
}
ocrLanguage = "deu"
verbose = False
import sys, subprocess
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr']
def human_log(res):
if type(res) == type(dict()):
for field in FIELDS:
if field in res.keys():
encoded_field = res[field].encode('utf-8')
print '\n{0}:\n{1}'.format(field, encoded_field)
@thewellington
thewellington / crashplanFixup.sh
Last active October 27, 2018 06:11
Prevent CrashPlan from de-duplicating data on a Mac. Improves transfer speed! #mac #blog #crashplan
#!/bin/bash
#
# crashplanFixup.sh for Macintosh OS X 10.9 (and probably earlier versions)
#
# This script will prevent CrashPlan from de-duplicating data on files greater than 1k.
# Based on information from http://networkrockstar.ca/2013/09/speeding-up-crashplan-backups/
#
# NOTE: Must be run with sudo! IE: $ sudo sh ./crashplanFixup
#
# v1.1 2014-03-13 by bill@wellingtonnet.net
@jorng
jorng / progressBar.applescript
Last active July 7, 2019 13:17
Simple AppleScript progress bar demo for Yosemite
set progress description to "A simple progress indicator"
set progress additional description to "Preparing…"
set progress total steps to -1
delay 5
set progress total steps to 100
repeat with i from 1 to 100
try
set progress additional description to "I am on step " & i
@vertan
vertan / ssh_badge
Created July 10, 2018 15:21
Dynamic Badge depending on environment in iTerm/SSH
# Put this in ~/.ssh/config
Host *.production.host.net
LocalCommand echo -e "\033]50;SetProfile=Production\a"
Host *.staging.host.net
LocalCommand printf "\033]50;SetProfile=Staging\a\e[0;m"
Host *
PermitLocalCommand yes
# End ~/.ssh/config
@foosel
foosel / README.md
Last active June 25, 2020 11:57
Patron Export Helper
@gregneagle
gregneagle / gist:6957826
Last active January 4, 2021 09:39
Using PyObjC and NSWorkspace to set the desktop picture. I am such a hypocrite!
#!/usr/bin/python
'''Uses Cocoa classes via PyObjC to set a random desktop picture on all screens.
Tested on Mountain Lion and Mavericks.
See:
https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWorkspace_Class/Reference/Reference.html
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html
@immae1
immae1 / .var.www.html.pihole.index.js
Last active February 12, 2021 16:55
This script is to add a random gif into the PIHOLE blockpage
// on page load, search for & display a random gif matching your search term using the Giphy API and add them to the pihole blockpage
// thanks to the nealrs (github)
// immae1 2017
var x = "Pi-hole: A black hole for Internet advertisements."
document.addEventListener('DOMContentLoaded', function () {
items = ["funny cats","dejay","nerd","beer"]; // tag array
var item = items[Math.floor(Math.random()*items.length)];
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
name: startup
name: startup
namespace: default
spec:
selector:
matchLabels:
@somebox
somebox / osx-setup.sh
Last active December 11, 2021 13:05 — forked from foz/osx-setup.sh.md
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc.
# Focused for ruby/rails development. Includes many utilities and apps:
# - homebrew, rvm, node
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, sublime text, postgres, chrome devtools, etc.
# - team: slack, dropbox, google drive, skype, etc