Skip to content

Instantly share code, notes, and snippets.

View j6s's full-sized avatar
✉️
hello@j6s.dev

Johannes Hertenstein j6s

✉️
hello@j6s.dev
View GitHub Profile
@j6s
j6s / README.md
Last active December 11, 2015 19:48 — forked from lovasoa/README.md

Ophir.php

PHP script that converts ODT to HTML

ophir.php is a lightweight script that parses an open document file and outputs a simple HTML file, with very few tags (contrarily to most other tools that do the same).

Features

Currently, the script parses bold (b tag), italic (i tag), underline (u tag), quotations (blockquote tag), images (using data URIs), links, headings (h1, h2, ...), lists (ul and li), tables (table tr and td) annotations and footnotes. Ophir.php can also ignore or remove some tags on demand. This can be useful if you want to extract only unformatted text from a document, or if you don't want tables, footnotes or annotations in the resulting HTML, or if the application that generated the ODT file produced unnecessary formatting informations ... This fork also is able to parse line-breaks (< br >), more to come

Limitations

# install gnu coreutils via homebrew
# this installs the gnu coreutils with g in front of them
# e.g. gecho
brew install coreutils findutils gnu-tar gnu-sed gawk gnutls gnu-indent gnu-getopt
# -----------------------
# add this to your terminal config file ~/.bashrc or ~/.zshrc
# this overrides the normal commands and maps them on the gnu ones
for a in "base64 basename cat chcon chgrp chmod chown chroot cksum comm cp
@j6s
j6s / bash-volume-alias.sh
Last active August 29, 2015 13:59
bash alias: set Volume
# ------------------------------- LINUX -------------------------------
# for Linux (requires alsa-utils which is installed on most major distributions)
# usage:
# set volume to 50%
# $ vol 50%
# increase volume by 10%
# $ vol 10%+
# decrease volume by 25%
# $ vol 25%-
@j6s
j6s / wrtbwmon.sh
Last active August 29, 2015 14:00
wrtbwmon
#!/bin/sh
#
# Traffic logging tool for OpenWRT-based routers
#
# Created by Emmanuel Brucy (e.brucy AT qut.edu.au)
#
# Based on work from Fredrik Erlandsson (erlis AT linux.nu)
# Based on traff_graph script by twist - http://wiki.openwrt.org/RrdTrafficWatch
#
# This program is free software; you can redistribute it and/or
@j6s
j6s / spotify_noAds.scpt
Created May 7, 2014 07:25
Mutes Spotify when Ads are playing
repeat
tell application "Spotify"
set cur_vol to sound volume
set trackk to track number of current track
set namme to name of current track
set pop to popularity of current track
set dur to duration of current track
set pos to player position
end tell
@j6s
j6s / onetimesetup.sh
Last active January 23, 2018 00:36
onetimesetup.sh
#!/bin/sh
##############################################################################################################
# onetime setup script for mac, including homebrew, some apps and some settings #
# full dotfile repository coming soon #
##############################################################################################################
#! /bin/bash
caskApps=$(ls /opt/homebrew-cask/Caskroom/) # Lists the casks in the Caskroom
apps=$(brew cask list);
for app in ${caskApps}; do # For every app there, do this
appToCheck=$(echo "${apps}" | grep "${app}") # If the app is not present in `brew cask list`, this variable will be empty
if [[ -z "${appToCheck}" ]]; then # If the variable is empty, then
echo "updating ${app}";
@j6s
j6s / Frame.xml
Last active August 29, 2015 14:03
{namespace flux=FluidTYPO3\Flux\ViewHelpers}
<f:layout name="Content" />
<f:section name="Configuration">
<flux:form id="frame" label="Frame" icon="Icons/Page.gif">
<!-- Insert fields, sheets, grid, form section objects etc. here, in this flux:flexform tag -->
<flux:grid>
<flux:grid.row>
<flux:grid.column>
<flux:form.content name="content" label="Inhalt"/>
{namespace flux=FluidTYPO3\Flux\ViewHelpers}
<f:layout name="Content" />
<f:section name="Configuration">
<flux:form id="frame" label="Frame" icon="Icons/Page.gif">
<!-- Insert fields, sheets, grid, form section objects etc. here, in this flux:flexform tag -->
<flux:grid>
<flux:grid.row>
<flux:grid.column>
<flux:form.content name="main" label="Inhalt"/>
/**
* @param array $filter
* @param array $fields
* @return array
*/
public function getFilterInfo($filter = array(),$fields = array()){
/**
* Formats the fields
*/
$statementFields = array();