Skip to content

Instantly share code, notes, and snippets.

Till Schulte-Coerne tillsc

Block or report user

Report or block tillsc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tillsc
tillsc / can_ids.md
Last active Feb 28, 2019
Brunner CAN IDs
View can_ids.md

BHZ 3.0 - 1.82

Bei sämtlichen hier aufgeführten Paketen handelt es sich um 4 Byte Daten. Das letzte Byte ist immer 0x00 und muss weg gelassen werden.

Temperaturen

ID Name Einh.
0x1c104009 VL HK1 (S1) °C/10
0x1c10400a VL HK2 (S2) °C/10
@tillsc
tillsc / galen-setup.js
Last active Sep 28, 2015
galen setup script tying to fix `clientWidth` in Browsers showing a vertical scrollbar
View galen-setup.js
function setup() {
// create driver and other stuff
// ...
driver.get(url);
var realWidth = inject(driver, 'return document.documentElement.clientWidth');
if (realWidth < size.width) {
var w = 2 * size.width - realWidth;
@tillsc
tillsc / dm-to_xlsx.rb
Last active Aug 29, 2015
to_xlsx for DataMapper
View dm-to_xlsx.rb
# -*- encoding : utf-8 -*-
module DataMapper
module Xlsx
module Model
def xlsx_columns
self.properties.reject{ |p| p.options[:no_export] }.
sort{ |a, b| (a.options[:export_pos] || 0) <=> (b.options[:export_pos] || 0) }.
View keybase.md

Keybase proof

I hereby claim:

  • I am tillsc on github.
  • I am tillsc (https://keybase.io/tillsc) on keybase.
  • I have a public key whose fingerprint is F789 21B7 A0EA 859A DDB8 97F8 E861 8608 B8CF E1E1

To claim this, I am signing this object:

@tillsc
tillsc / index.html
Last active Dec 21, 2015
Discussion about RDFa vs. POSH with @tistre
View index.html
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
<meta charset="UTF-8" />
<title>
Story: 1828128 from BAB / BNH, page 3 from Thursday, July 25, 2013 – DC-X 1.7.8.0 BTAG API
</title>
<link href="http://dcxtrunk.digicol.de/dcx_static/trunk/bootstrap/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
</head>
@tillsc
tillsc / gist:4233025
Created Dec 7, 2012
Defining a JNDI OracleConnectionPool in JRuby for testing purposes
View gist:4233025
if RUBY_PLATFORM =~ /java/
require 'java'
# Add ojdbc to the Java classpath
$CLASSPATH << File.expand_path('../../lib/ojdbc5.jar', __FILE__)
# Simply add all apache tomcat libs (some juli.jar might need to be added too)
Dir.glob("/usr/local/Cellar/apache-tomcat/6.0.24/lib/*.jar") do |filename|
$CLASSPATH << filename
end
@tillsc
tillsc / eager_loading.rb
Created Jul 23, 2012
Eager Loading DM associations
View eager_loading.rb
# Usage:
#
# customers = Customer.all
# customers.eager_load(Customer.orders.line_items.item, Customer.address)
#
module DataMapper
module EagerLoading
def eager_load(*query_paths)
@tillsc
tillsc / my_helper.rb
Created Mar 8, 2012
all_errors helper method for DataMapper 1.2
View my_helper.rb
module DataMapper
module MyHelpers
def all_errors(seen=[])
return [] if seen.include?(self)
seen << self
res = self.errors
parent_relationships.each do |relationship|
association = relationship.get!(self)
View gist:1898836
#libaries
require 'rubygems' rescue nil
require 'irb/completion'
begin
# load hirb
$: << '/Library/Ruby/Gems/1.8/gems/hirb-0.5.0/lib'
require "hirb"
# start hirb
@tillsc
tillsc / gist:1284040
Created Oct 13, 2011
dm-oracle-adapter patch for indices with long table names
View gist:1284040
def create_index_statement(model, index_name, fields)
table_name = model.storage_name(name)
table_name_short = table_name.split("_").map{|s|s[0..3]}.join("_")
DataMapper::Ext::String.compress_lines(<<-SQL)
CREATE INDEX #{quote_name("i_#{table_name_short}_#{index_name}")} ON
#{quote_name(table_name)} (#{fields.map { |field| quote_name(field) }.join(', ')})
SQL
end
You can’t perform that action at this time.