Skip to content

Instantly share code, notes, and snippets.

View skeller1's full-sized avatar
🎯
Focusing

Stephan Keller skeller1

🎯
Focusing
View GitHub Profile
@skeller1
skeller1 / BootstrapDark-4.theme
Created January 24, 2024 10:04
BootstrapDark-4.theme
{
"name": "BootstrapDark-4",
"settings": {
"borderRadius": 4,
"focusBlurRadius": 1,
"focusBorderSize": 3
},
"fonts": {
"default": {
"size": 13,
@skeller1
skeller1 / .env
Last active March 15, 2023 12:25
ElsterTransfer E4K Sample Docker Setup
ETR_EINSTELLUNGEN_ELSTERZERTIFIKAT_PASSWORT=<PASSWORD>
ETR_EINSTELLUNGEN_PROXY_PASSWORT=<PASSWORD>
SERVER_SSL_KEY_STORE_PASSWORD=<PASSWORD>
@skeller1
skeller1 / mdb2csv2db.rb
Created July 31, 2012 20:44
Gist for converting mdb files to csv including read in data for saving with active record
require "csv"
p "Start transforming all data from available access databases to csv file"
Dir.glob('*.mdb',File::FNM_CASEFOLD) do |mdb_file|
table_list = `mdb-tables #{mdb_file}`.split(/[\s]/)
table_list.each do |table|
`mdb-export -d ";" #{mdb_file} #{table} > #{table}_#{Time.now.strftime("%Y-%m-%d-%H%M%S")}.csv`
@skeller1
skeller1 / simulate put.html
Created September 14, 2011 11:13
simulate put
<form accept-charset="UTF-8" action="/categories/1" class="edit_category" id="edit_category_1" method="post"><div>
<input name="utf8" type="hidden" value="&#x2713;" />
<input name="_method" type="hidden" value="put" />
<input name="authenticity_token" type="hidden" value="2iX9wYiqhIvSxC7F/CwJGlA1D59K5paOQug4vrqPwFo=" /></div>
<div class="field">
<label for="category_name">Name</label><br />
<input id="category_name" name="category[name]" size="30" type="text" value="Max Mustermann" />
</div>
<div class="field">
<label for="category_description">Description</label><br />
@skeller1
skeller1 / spring.xml
Created September 14, 2011 07:37
xml spring config file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
@skeller1
skeller1 / middleware.rb
Created September 8, 2011 16:21
rails middleware
def call(env)
#some stuff
req_env=env.dup
controller = "ProjectsController"
method = "index"
@skeller1
skeller1 / ghost.rb
Created September 8, 2011 13:32
metaprogramming ghost method
class MyClass
def method_missing(method,*args)
p "Called #{method}"
end
end
object = MyClass.new
@skeller1
skeller1 / introspection.rb
Created September 8, 2011 13:16
introspection
class MyClass
def my_method1
p "my method1"
end
def my_method2
p "my method2"
end
@skeller1
skeller1 / extdirect.rb
Created September 5, 2011 15:47
routing of an extjs request
# register middleware
config.use.middleware "ExtDirectRouter" "my/special/url"
#Calling the extjs router brings me the class of the controller as raw http json request or form_post
# more here http://rubyforge.org/docman/view.php/7639/9465/Ext.Direct-pre-alpha.pdf
#I can change the request uri in the controller and starts a new @app.call, than return the response
# example is here https://github.com/extjs/direct-rails/blob/master/lib/rack/remoting_provider.rb
class MyClass
def foo(bar)
end
def bar(baz, foo)
end