Skip to content

Instantly share code, notes, and snippets.

View kassi's full-sized avatar

Karsten Silkenbäumer kassi

View GitHub Profile
@kassi
kassi / make_deck.rb
Last active April 12, 2021 20:55
Quick & dirty deck builder for Tabletop Simulator. No command line help yet. Configure at the ed of the script!
#!/usr/bin/env ruby
# encoding: utf-8
# tested with Ruby 2.7.2
# Builds a deck of cards or similar objects using a list of input images and (optional) multiplicators.
# All cards need to have same size
class TableTopDeckBuilder
attr_accessor :name, :glob, :back_image, :hidden_card_image, :mults, :remove_intermediates
attr_accessor :cards, :card_width, :card_height
@kassi
kassi / README.md
Last active June 21, 2021 11:35
Reflect your zoom status in slack.

Simple hammerspoon service to set slack status when you're in a zoom call and back.

  1. Create or install a slack app that provides an API token (e.g. "API Token")
  2. Write the token to ~/.config/slack/token
  3. Install hammerspoon (https://www.hammerspoon.org/, brew install hammerspoon) and the the files below into ~/.hammerspoon or merge them (init.lua)
  4. If your language is "zh", check the local in zoom.lua.
@kassi
kassi / gist:59f7876505735e09183c6cb866462728
Created November 9, 2018 17:42
Apple bug report for Cutter 1.7.2
Process: Cutter.bin [38740]
Path: /Applications/Cutter.app/Contents/MacOS/Cutter.bin
Identifier: org.radare.cutter
Version: 1.7.2 (1.7.2)
Code Type: X86-64 (Native)
Parent Process: ??? [38738]
Responsible: Cutter.bin [38740]
User ID: 501
Date/Time: 2018-11-09 18:17:03.932 +0100
@kassi
kassi / client_paydata_section.rb
Last active June 22, 2018 10:02
Failing site_prism / capybara test reduced to the relevant parts
# frozen_string_literal: true
##
# Client paydata section containing the client billing address (removed) and the payment method as subsections.
#
class ClientPaydataSection < SitePrism::Section
class ClientPaymentMethodSection < SitePrism::Section
element :show, ".payment-method-section .show-layer"
element :edit_button, "a#edit_payment_method_button"
element :edit_form, ".payment-method-section .edit-layer"
LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.1.1/bin/ruby
PassengerMaxPoolSize 10
PassengerMinInstances 1
PassengerDebugLogFile /var/log/passenger.log
PassengerFriendlyErrorPages off
</IfModule>
@kassi
kassi / gist:9473340
Last active August 29, 2015 13:57 — forked from reiz/gist:9468356
def self.create_index_with_mappings
Tire.index Settings.elasticsearch_product_index do
create :settings => {
:number_of_shards => 1,
:number_of_replicas => 1,
:analysis => {
:filter => {
:name_ngrams => {
:side => 'front',
:type => 'edgeNGram',
@kassi
kassi / .bash_functions
Created August 29, 2013 20:15
Excerpt of my .bash_functions: function ci
function ci {
command="$*"
filename="/tmp/ci-$RANDOM-$$"
if [ "$1" == "rails" -a "$2" == "new" -a -n "$3" ]; then
echo "Initialize new rails app" > $filename
echo >> $filename
echo "Command:" >> $filename
echo " $command" >> $filename
$command && cd "$3" && git init && git add . && git commit -a -F $filename
@kassi
kassi / starter-app.rb
Created November 7, 2012 00:52
Rails Starter App defaults file
rails_apps_composer new my_app -d starter-app.yml
@kassi
kassi / gist:3224919
Created August 1, 2012 08:18
Update URLs in Safari Bookmarks & History
# close Safari!
cd ~/Library/Safari
cp Bookmarks.plist History.plist ~ # make a backup!!
# convert to readable
plutil -convert xml1 Bookmarks.plist
plutil -convert xml1 History.plist
# change with regex
@kassi
kassi / .perlcriticrc
Created July 18, 2012 21:36
System Files: perl
[CodeLayout::RequireTidyCode]
perltidyrc = ~/.perltidyrc
[-Miscellanea::RequireRcsKeywords]
[-Documentation::RequirePodAtEnd]
[-Documentation::RequirePodSections]