Skip to content

Instantly share code, notes, and snippets.

View mfts's full-sized avatar
🎯
Focusing on open source

Marc Seitz mfts

🎯
Focusing on open source
View GitHub Profile
@mfts
mfts / haiku
Created February 7, 2016 15:50 — forked from friggeri/haiku
random heroku-like name generator
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 / import_json_appsscript.js
Created February 18, 2016 12:22 — 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.
/**
* 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();
// 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";
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@mfts
mfts / Bash Prompt
Last active December 12, 2018 10:24
Terminal prompt to show "user@computer:working_directory (git_branch) $ "
# 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\] $ "
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;",
@mfts
mfts / .zshrc
Last active December 5, 2019 20:35
Zsh Prompt to show dirty and clean status of git branch
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))/"
}
@mfts
mfts / sidekiq_monitoring
Created May 24, 2020 22:50 — forked from ngsmrk/sidekiq_monitoring
Sidekiq queue checking via rails console
stats = Sidekiq::Stats.new
stats.queues
stats.enqueued
stats.processed
stats.failed
@mfts
mfts / install-docker.sh
Last active December 11, 2020 13:17
Install Docker Bash Script
#!/bin/bash
adduser sdui
usermod -aG sudo sdui
apt update
apt install ufw
ufw allow OpenSSH
ufw allow 10000/udp
ufw allow 4443/tcp
@mfts
mfts / package.yml
Created December 8, 2022 14:02
tea minimal package.yml
distributable:
url: https://example.org/download/{{version}}/src.tar.gz
strip-components: 1
versions:
- 1.0.0
build:
script: |
touch "{{prefix}}"/example