Skip to content

Instantly share code, notes, and snippets.

View MichaelSp's full-sized avatar
👏
I'm happy and I know it 👏

Michael MichaelSp

👏
I'm happy and I know it 👏
View GitHub Profile
@hollygood
hollygood / pass-async-data-to-child.ts
Created January 8, 2019 14:20
Angular 6 Pass Async Data to Child Components
// blogger.component.ts
...
template: `
<h1>Posts by: {{ blogger }}</h1>
<div>
<posts [data]="posts"></posts>
</div>
`
...
import { Directive, Input, TemplateRef, ViewContainerRef, OnInit } from '@angular/core';
import { CONFIG } from 'environments/config';
@Directive({
selector: '[featureToggle]'
})
export class FeatureToggleDirective implements OnInit {
@Input() featureToggle: string;
constructor(
@d11wtq
d11wtq / docker-ssh-forward.bash
Created January 29, 2014 23:32
How to SSH agent forward into a docker container
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
@pehrlich
pehrlich / full_error_messages.rb
Created February 4, 2013 23:51
Print out full error messages for nested models
module FullErrorMessages
extend ActiveSupport::Concern
# includes errors on this model as well as any nested models
def all_error_messages
messages = self.errors.messages.dup
messages.each do |column, errors|
if self.respond_to?(:"#{column}_attributes=") && (resource = self.send(column))
messages[column] = resource.errors.messages
end
class BankAccount < ActiveRecord::Base
# Umsätze von start_date bis end_date abrufen
# * passport_type, passphrase, pin und file kommen in dieser Implementation aus der zugrunde liegenden Tabelle.
# * Wenn passport_type = "PinTan" ist, wird die pin verwendet.
# * Wenn passport_type = "RDHNew" ist, wird die Schlüsseldatei aus filename verwendet und mit der passphrase entschlüsselt.
def get_transactions(start_date, end_date)
HBCIUtils.setParam("client.passport.#{passport_type}.filename", filename)
HBCIUtils.setParam("client.passport.#{passport_type}.init", '1')