Skip to content

Instantly share code, notes, and snippets.

View klyonrad's full-sized avatar

Luka Lüdicke klyonrad

  • Germany, Frankfurt am Main
View GitHub Profile
@klyonrad
klyonrad / LinkeZeitungenZahlwandSchliesen.js
Last active October 10, 2015 14:22
Zahlwand bei deutschen linken Zeitungen schließen
// to use on http://www.neues-deutschland.de
var paywallOptions = document.getElementsByClassName('Paywall-Option');
paywallOptions[paywallOptions.length-1] // get last item "Ich beteilige mich schon regelmäßig"
.click();
// taz.de
document.getElementsByClassName('tzi-close')[0].click();
module Indoctrinatr
module Tools
module TemplatePackHelpers # classes that use this model are required to have template_pack_name as instance variable
def path_name(template_pack_name) template_pack_name
Pathname.new(Dir.pwd).join template_pack_name
end
def assets_path template_pack_name
path_name(template_pack_name).join 'assets'
end
# , Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
# rubocop:disable all, # fuck the police
def check_attributes # rubocop:disable Metrics/AbcSize, Metrics/BlockNesting # fuck the police
configuration = ConfigurationExtractor.new(template_pack_name).call
puts 'checking your attributes...'
# puts configuration.attributes_as_hashes_in_array
configuration.attributes_as_hashes_in_array.each_with_index do |attribute_hash, index|
if attribute_hash.key? 'name'
if attribute_hash['name'].nil?
@klyonrad
klyonrad / template_documentation_content.rb
Created August 17, 2015 13:13
indoctrinatr_appendix
require 'indoctrinatr/tools/template_pack_configuration'
require 'indoctrinatr/tools/directory_helpers'
require 'indoctrinatr/tools/template_documentation_source_file'
require 'indoctrinatr/tools/default_values'
module Indoctrinatr
module Tools
class TemplateDocumentationContent
include DirectoryHelpers
@klyonrad
klyonrad / dir_dirtree.rb
Last active November 29, 2019 15:58
ruby print_dirtree_style
# license: MIT
require 'to_latex'
module Indoctrinatr
module Tools
class DirectoryHelpers
def initialize
@dirtree_lines = []
end
S -> E
E -> E a | T
T -> T b | E c | d
eliminate left-recursion:
E -> T E'
E' -> a E' | ε
T -> d T'
// myShell.cpp : Defines the entry point for the console application.
//
// #include <unistd.h>
#include <string>
#include <iostream>
#include <sstream>
#include <vector>
using std::cin;
using std::cout;