Skip to content

Instantly share code, notes, and snippets.

@thorsteneckel
thorsteneckel / snippets
Last active March 17, 2018 21:22
Disable all ruby snippets from Sublime 3
# mac version
unzip -l /Applications/Sublime\ Text.app/Contents/MacOS/Packages/Ruby.sublime-package | grep '.sublime-snippet' | awk '{print $4}' | xargs -L 1 -I {} touch ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/Ruby/{}
@thorsteneckel
thorsteneckel / books_controller.rb
Last active November 10, 2015 08:36 — forked from cupakromer/books_controller.rb
Rails 4 Standard CRUD Controller
# This is a fairly basic / bare controller which does only the basic CRUD.
class BooksController < ApplicationController
before_action :set_book, only: [:show, :edit, :update, :destroy]
def index
respond_with @books = Book.all
end
def show
respond_with @book
@thorsteneckel
thorsteneckel / Steps.md
Last active March 8, 2019 13:03
ejurgensen/forked-daapd on FreeBSD 10.1

forked-daapd on FreeBSD 10.1

These are my steps installing 'ejurgensen/forked-daapd' on my FreeBSD 10.1 amd64 using user root and editor joe. Feedback would be great!

create working folder

export WORKDIR=/usr/local/src/forked-daapd
mkdir -p $WORKDIR
cd $WORKDIR
@thorsteneckel
thorsteneckel / facebook_com_video_link.js
Created December 16, 2014 23:13
Extract video links from facebook.com via JS console of your browser
@thorsteneckel
thorsteneckel / OTRSSubjectParse.js
Last active August 29, 2015 14:11
Parse OTRS subject for TicketNumber and Title in JavaScript
function SubjectParse ( Subject, Hook ) {
var Data = {};
var SubjectRegExp = new RegExp( '^'+ Hook + '(\\d+)\\s*(?:-|–)\\s*(.+)$','');
var Match = SubjectRegExp.exec(Subject);
if ( Match && Match.length ) {
Data['Subject'] = Match[0];
Data['TicketNumber'] = Match[1];
@thorsteneckel
thorsteneckel / SOPMFileList.sh
Last active August 29, 2015 14:10
Find statement to get list of files for OTRS SOPM Filelist
# Explanation:
#
# find
# -name .git -prune -o = skip everything with .git in the name
# -type d -o = skip folders
# -name .DS_Store -prune -o = skip Mac OS X .DS_Store files
# -name "*.sopm" -prune -o = skip SOPM file itself
# -print
#
# sed
@thorsteneckel
thorsteneckel / HowTo.txt
Last active August 29, 2015 14:03
Display pending time in date format in AgentTicketZoom (KIX4OTRS)
Usualy the pending time is displayed like this in the AgentTicketZoom view:
Pending till:
23 h
49 m
This gist describes how to change the display format to:
Pending till:
26.06.2014 19:30