Skip to content

Instantly share code, notes, and snippets.

@bf4648
bf4648 / meteor-ses-heorku.md
Created December 2, 2020 21:47 — forked from nate-strauser/meteor-ses-heorku.md
Email configuration to Amazon SES with Meteor on Heroku

Follow instructions below to get meteor emails sending correctly from heroku using amazon ses

  1. set up smtp access via aws console, get your smtp credentials

  2. using a javascript console (chrome dev tools / firebug) run

encodeURIComponent("SES_SMTP_USERNAME")

encodeURIComponent("SES_SMTP_PASSWORD")

@bf4648
bf4648 / shp2geojson.js
Created November 17, 2020 22:22 — forked from springmeyer/shp2geojson.js
shapefile to geojson in node.js with mapnik
var geojsonStream = require('geojson-stream');
var mapnik = require('mapnik');
var fs = require('fs');
var input = 'test/data/world_merc.shp';
var output = './out.geojson';
// set up geojson output stream
var fileOut = fs.createWriteStream(output);
var geojsonOut = geojsonStream.stringify();
@bf4648
bf4648 / mac.md
Created September 12, 2020 18:28 — forked from lornajane/mac.md
Keyboard Only OS X

Keyboard-only Mac Cheatsheet

Hi, I'm Lorna and I don't use a mouse. I have had RSI issues since a bad workstation setup at work in 2006. I've tried a number of extra hardware modifications but what works best for me is to use the keyboard and only the keyboard, so I'm in a good position and never reaching for anything else (except my coffee cup!). I rather unwisely took a job which required me to use a mac (I've been a linux user until now and also had the ability to choose my tools carefully) so here is my cheatsheet of the apps, tricks and keyboard shortcuts I'm using, mostly for my own reference. Since keyboard-only use is also great for productivity, you may also find some of these ideas useful, in which case at least something good has come of this :)

Apps List

There's more detail on a few of these apps but here is a quick overview of the tools I've installed and found helpful

Tool Link Comments
@bf4648
bf4648 / tmux.conf
Created July 24, 2020 19:17 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@bf4648
bf4648 / doc_to_pdf.py
Created July 3, 2020 16:21 — forked from wolframalpha/doc_to_pdf.py
Please add this to your code and report!
import os
import subprocess
import shlex
import time
def convert_doc_to_pdf(ipfile_path, opfile_path):
subprocess.Popen(shlex.split('libreoffice --headless --convert-to pdf "{}" --outdir "{}"'.format(ipfile_path, opfile_path)), stdout=True)
@bf4648
bf4648 / pdfTextMiner.py
Created July 1, 2020 00:11 — forked from vinovator/pdfTextMiner.py
A sample code which uses pdfminer module to extract text from pdf files
# pdfTextMiner.py
# Python 2.7.6
# For Python 3.x use pdfminer3k module
# This link has useful information on components of the program
# https://euske.github.io/pdfminer/programming.html
# http://denis.papathanasiou.org/posts/2010.08.04.post.html
''' Important classes to remember
PDFParser - fetches data from pdf file
Mac Network Commands Cheat Sheet
After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and stay salty.
Get an ip address for en0:
ipconfig getifaddr en0
Same thing, but setting and echoing a variable:
@bf4648
bf4648 / incremental_tags.vim
Created May 25, 2020 00:25 — forked from Flolagale/incremental_tags.vim
Generate ctags incrementally in vim. Juste paste this into your .vimrc.
function! GenerateTagsIncrementally()
python << EOF
import os
print('Generating tags incrementally.')
# Walk the file tree, if a file has an mtime more recent than the tag file,
# add it to the list of files to index.
tags_mtime = os.stat('tags').st_mtime
with open('list', 'w') as fp:
for dirpath, dirnames, filenames in os.walk(os.getcwd()):
for filename in filenames:
@bf4648
bf4648 / README.md
Created May 22, 2020 20:38
Squid Setup

Squid Setup

Install

# brew install squid2

Update squid conf

# vim /usr/local/Cellar/squid2/2.7.9/etc/squid.conf