Skip to content

Instantly share code, notes, and snippets.

View seveves's full-sized avatar
:octocat:
always dark mode on

Severin seveves

:octocat:
always dark mode on
  • Germany, Stuttgart
View GitHub Profile
@seveves
seveves / openssl.txt
Created March 29, 2019 21:21
Self Signed Certs
MAC:sha1 Iteration 2048
PKCS7 Encrypted data: pbeWithSHA1And40BitRC2-CBC, Iteration 2048
Certificate bag
Bag Attributes
localKeyID: 96 49 56 7A CB 11 F1 01 AC C2 F6 4D 05 B1 43 D9 D0 1A 0E 90
subject=/C=US/O=TEST/CN=severinTestDevice
issuer=/C=US/O=TEST/CN=severinTestDevice
-----BEGIN CERTIFICATE-----
MIIDRjCCAi6gAwIBAgIJALotsxv34i0YMA0GCSqGSIb3DQEBCwUAMDgxCzAJBgNV
BAYTAlVTMQ0wCwYDVQQKDARURVNUMRowGAYDVQQDDBFzZXZlcmluVGVzdERldmlj
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@seveves
seveves / tslint.json
Created June 20, 2017 14:17
example tslint config
{
"extends": "tslint:recommended",
"rulesDirectory": ["path/to/custom/rules/directory/", "another/path/"],
"rules": {
"max-line-length": {
"options": [120]
},
"new-parens": true,
"no-arg": true,
"no-bitwise": true,
@seveves
seveves / checkbox.componen.ts
Created February 20, 2017 12:33
Angular Checkbox
import { AfterViewChecked, Component, EventEmitter, Input, Output } from '@angular/core';
@Component({
selector: 'seveves-checkbox',
template: `
<fieldset class="form-group">
<div class="form-check">
<label class="form-check-label" [for]="name">
<input type="checkbox"
[id]="name"
@seveves
seveves / search-box.ts
Created February 20, 2017 07:05
RxJS problem
languageChangedSubscription = this.languageService.languageChanged
.subscribe((language: string) => {
this.updateViewData(language);
});
updateViewData(language: string) {
this.searchResults = this.searchBox.valueChanges
.let((text: Observable<string>) => this.filterAndDebounceFor(text)(150))
.switchMap((searchTerm: string) => this.helpDataService.search(searchTerm, language));
public ngOnInit() {
this.navigationResults = this.helpDataService.getMainGroups()
.concat(this.filterBox.valueChanges
.let((text: Observable<string>) => this.filterAndDebounceFor(text)(500))
.switchMap((filterTerm: string) =>
this.defaultObservableIfEmpty(
this.helpDataService.getNavigationByFilter(filterTerm),
this.helpDataService.getMainGroups())));
}
@seveves
seveves / index.tsx
Created January 17, 2017 19:49
List and ListItem Preact
import { Component, h } from 'preact';
import ListItem from '../list-item';
export default class List extends Component<{}, { indices: number[] }> {
state = { indices: [0, 1, 2, 3] };
public render() {
return (
@seveves
seveves / index.spec.ts
Created January 13, 2017 11:43
Angular2 + Karma (very simple setup)
import 'core-js/es6';
import 'core-js/es7/reflect';
import 'reflect-metadata';
import 'zone.js/dist/zone';
import 'zone.js/dist/long-stack-trace-zone';
import 'zone.js/dist/proxy';
import 'zone.js/dist/sync-test';
import 'zone.js/dist/jasmine-patch';
import 'zone.js/dist/async-test';
@seveves
seveves / swipe-recognizer.jsx
Last active August 5, 2019 18:22
Preact swipe recognizer
import { Component, h, cloneElement } from 'preact';
export default class SwipeRecognizer extends Component {
tolerance = 100;
gesture = { x: [], y: [], match: '' };
componentDidMount() {
this.base.addEventListener('touchstart', this.capture);
this.base.addEventListener('touchmove', this.capture);
this.base.addEventListener('touchend', this.compute)
Trying to lazy load images.