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
# 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
#! /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();
{namespace flux=FluidTYPO3\Flux\ViewHelpers}
{namespace nim=nim\nimelements\ViewHelpers}
<f:layout name="Content" />
<f:section name="Configuration">
<flux:form id="button" label="Button" icon="../typo3conf/ext/nimelements/Resources/Public/icons/button.png">
<!-- Insert fields, sheets, grid, form section objects etc. here, in this flux:flexform tag -->
<flux:field.input name="url">
<flux:wizard.link label="URL"/>
@j6s
j6s / fce.html
Last active August 29, 2015 14:07
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
{namespace flux=FluidTYPO3\Flux\ViewHelpers}
<f:layout name="Content" />
<f:section name="Configuration">
<flux:form id="Mehrspaltig" label="Mehrspaltig" icon="typo3conf/ext/nimelements/Resources/Public/icons/frame.png">
{f:if(condition: settings.gridColumns, then: settings.gridColumns, else: 12) -> v:variable.set(name: 'numberOfColumns')}
<flux:field.checkbox name="settings.fluid" />
<flux:form.section name="columns">
<flux:form.object name="column">