Skip to content

Instantly share code, notes, and snippets.

Avatar

Erik Behrends behrends

View GitHub Profile
View constraint layout 28.08.20 14:35
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/textView2"
@behrends
behrends / gist:4072120
Created Nov 14, 2012
Getting a free SSL certificate
View gist:4072120

Getting a free certificate

This page guides you through the process of obtaining an HTTPS certificate for your site. This is a real certificate, not a self-signed certificate, and works in all major browsers.

The CA which we'll use is StartSSL. They provide basic certificates for free, although will charge for other types, such as wildcard certificates.

Generating a public/private keypair

A keypair can be generated with OpenSSL:

View AppDatabase.kt
package com.example.roomexample
import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
@Database(entities = [Person::class], version = 1)
abstract class AppDatabase : RoomDatabase() {
abstract fun personDao(): PersonDao
View OrderTextView
<TextView
android:id="@+id/order_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="8dp"
android:text="Order:"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
@behrends
behrends / workshop20181130.md
Last active Nov 30, 2018
React Native Workshop CAS 30.11.2018
View workshop20181130.md

Workshop zu React Native am CAS am 30.11.2018

Hier sind die relevanten Änderungen der einzelnen Schritte zu sehen.

10:05: neues Snack-Projekt

App.js

import React from 'react';
@behrends
behrends / App.js
Created Jul 4, 2018
14:10 - Zitat der Liste hinzufügen
View App.js
import React, { Component } from 'react';
import { Button, StyleSheet, View } from 'react-native';
import Quote from './js/components/Quote';
import NewQuote from './js/components/NewQuote';
const data = [
{
text:
'Probleme kann man niemals mit derselben Denkweise lösen, durch die sie entstanden sind.',
author: 'Albert Einstein'
@behrends
behrends / NewQuote.js
Created Jul 4, 2018
13:55 - Modal mit TextInputs
View NewQuote.js
import React, { Component } from 'react';
import { Modal, StyleSheet, Text, TextInput, View } from 'react-native';
export default class NewQuote extends Component {
render() {
return (
<Modal
visible={this.props.visible}
onRequestClose={this.props.onRequestClose}
>
@behrends
behrends / App.js
Created Jul 4, 2018
13:45 - Modal in Komponente NewQuote
View App.js
import React, { Component } from 'react';
import { Button, StyleSheet, View } from 'react-native';
import Quote from './js/components/Quote';
import NewQuote from './js/components/NewQuote';
const data = [
{
text:
'Probleme kann man niemals mit derselben Denkweise lösen, durch die sie entstanden sind.',
author: 'Albert Einstein'
View gist:f5037aa17e9323858046aa59155c49fd
import React, { Component } from 'react';
import { Button, Modal, StyleSheet, Text, View } from 'react-native';
import Quote from './js/components/Quote';
const data = [
{
text:
'Probleme kann man niemals mit derselben Denkweise lösen, durch die sie entstanden sind.',
author: 'Albert Einstein'
},
@behrends
behrends / Quote.js
Created Jul 4, 2018
13:20 - Quote mit Styling
View Quote.js
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default class Quote extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.text}>{this.props.text}</Text>
<Text style={styles.author}>&mdash; {this.props.author}</Text>
</View>
You can’t perform that action at this time.