Skip to content

Instantly share code, notes, and snippets.

Marc Seitz mfts

Block or report user

Report or block mfts

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mfts
mfts / letsencrypt.sh
Created Jan 29, 2020
Create Letsencrypt wildcard certificate
View letsencrypt.sh
brew install certbot
# change <my.domain> to preferred domain
certbot certonly --manual --preferred-challenges dns --server https://acme-v02.api.letsencrypt.org/directory --manual-public-ip-logging-ok -d '*.<my.domain>' -d <my.domain>
# add certificates to heroku
heroku certs:add -a eduqai-prod /etc/letsencrypt/live/<my.domain>/fullchain.pem /etc/letsencrypt/live/<my.domain>/privkey.pem
# may need to run with sudo
@mfts
mfts / .zshrc
Last active Dec 5, 2019
Zsh Prompt to show dirty and clean status of git branch
View .zshrc
autoload -U colors && colors
setopt prompt_subst
# Get branch and open commits in prompt
function git-dirty() {
[[ $(git status 2>/dev/null | tail -n1) != "nothing to commit, working tree clean" ]] && echo "*"
}
function parse_git_branch() {
git branch 2> /dev/null | sed -e "/^[^*]/d" -e "s/* \(.*\)/ (\1$(git-dirty))/"
}
View update
module.exports = [
{
"ID": 1,
"Content": "Diagnose Number",
"Prefix": "",
"OPC UA Node ID": "Application.USERVARGLOBAL.enErrorID_gb",
"Data Source": "UserVarGlobal",
"Data Access": "Read",
"Data Format": "INT",
"Data Unit": "16#0=No Error; 16#1=Invalid Input; 16#2= com. Error; 16#3=Resource Error; 16#4=Access Error; 16#5=State Error; 16#6=Out of Range; 16#7=Calc. Error; 16#8=Device Error; 16#7EEE=Undef. Error; 16#7FFF=System Error;",
View gist:8f602b7c09fe8c196422cd7581562ac1
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
View Remove Photo Tags on Facebook
// This little script lets you untag photos on Facebook. While only 10 at a time, I'm working on untagging multiple ones at once. Also you kinda have to preload, i.e. scroll down on the page, until as much tagged photos are loaded that you wish to iterate over.
// (1) Go to https://www.facebook.com/{YOURFACEBOOKIDHERE}/allactivity?log_filter=taggedphotos
// (2) Copy all JS from this page http://code.jquery.com/jquery-latest.min.js and
// (3) Paste into console
// (4) JQuery selectors $(..) are now available
// The following are lines to be entered into the console each at a time. (I was lazy)
var nameOfTagger = "Peter Pan";
@mfts
mfts / import_json_appsscript.js
Created Feb 18, 2016 — forked from chrislkeller/import_json_appsscript.js
Adds what amounts to an =ImportJSON() function to a Google spreadsheet... To use go to Tools --> Script Editor and add the script and save.
View import_json_appsscript.js
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@mfts
mfts / haiku
Created Feb 7, 2016 — forked from friggeri/haiku
random heroku-like name generator
View haiku
haiku = ->
adjs = [
"autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark",
"summer", "icy", "delicate", "quiet", "white", "cool", "spring", "winter",
"patient", "twilight", "dawn", "crimson", "wispy", "weathered", "blue",
"billowing", "broken", "cold", "damp", "falling", "frosty", "green",
"long", "late", "lingering", "bold", "little", "morning", "muddy", "old",
"red", "rough", "still", "small", "sparkling", "throbbing", "shy",
"wandering", "withered", "wild", "black", "young", "holy", "solitary",
"fragrant", "aged", "snowy", "proud", "floral", "restless", "divine",
@mfts
mfts / Bash Prompt
Last active Dec 12, 2018
Terminal prompt to show "user@computer:working_directory (git_branch) $ "
View Bash Prompt
# Copy the functions below to your ~/.bash_profile
git-dirty() {
[[ $(git status 2>/dev/null | tail -n1) != "nothing to commit, working tree clean" ]] && echo "*"
}
parse_git_branch() {
git branch 2> /dev/null | sed -e "/^[^*]/d" -e "s/* \(.*\)/ (\1$(git-dirty))/"
}
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[0;34m\$(parse_git_branch)\[\033[00m\] $ "
You can’t perform that action at this time.