Skip to content

Instantly share code, notes, and snippets.

Avatar

Erik Behrends behrends

View GitHub Profile
@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>
@behrends
behrends / App.js
Created Jul 4, 2018
11:40 - Zitat als Komponente
View App.js
import React, { Component } from 'react';
import { Button, StyleSheet, 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
11:30 - In js/components/
View Quote.js
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default class Quote extends Component {
render() {
return <Text>Hallo!!!!!!!!!!!</Text>;
}
}
@behrends
behrends / App.js
Created Jul 4, 2018
11:00 - Drei Zitate
View App.js
import React, { Component } from 'react';
import { Button, StyleSheet, Text, View } from 'react-native';
const data = [
{
text:
'Probleme kann man niemals mit derselben Denkweise lösen, durch die sie entstanden sind.',
author: 'Albert Einstein'
},
{
@behrends
behrends / data.js
Created Jul 4, 2018
10:55 - Zitate
View data.js
const data = [
{
text:
'Probleme kann man niemals mit derselben Denkweise lösen, durch die sie entstanden sind.',
author: 'Albert Einstein'
},
{
text:
'Man braucht nichts im Leben zu fürchten, man muss nur alles verstehen.',
author: 'Marie Curie'
@behrends
behrends / App.js
Created Jul 4, 2018
10:05 - Aufbau Komponente
View App.js
// i.d.R. 3 Blöcke
// 1) imports
// ES 2015!
import React, { Component } from 'react';
// verwendete UI-Komponenten und APIs importieren
import { Button, StyleSheet, Text, View } from 'react-native';
// 2) Komponente
@behrends
behrends / Eingabe.java
Created Nov 29, 2017
Eingabe in Java mit Scanner
View Eingabe.java
import java.util.Scanner;
public class Eingabe {
public static void main(String[] args) {
int number = 8;
String text = "Text";
Scanner scanner = new Scanner(System.in);
// Eingabe
System.out.print("Zahl eingeben: ");
@behrends
behrends / tail-recursive.rb
Created Aug 6, 2011 — forked from anonymous/tail-recursive.rb
notes on Ruby Tail Call Optimization
View tail-recursive.rb
# First, I suppose you have ruby 1.9.1 or 1.9.2
# Open irb. Execute this:
# RubyVM::InstructionSequence.compile_option = { tailcall_optimization: true, trace_instruction: false }
# Note, RubyVM::InstructionSequence.compile_option() doesn't have item :trace_instruction, still, you need to specify it. WTF?
# Also, it doesn't work if you just put it to the script. Don't know why yet. Tell me (@rofh) if you know.
# Then open the file:
# require "./tail-recursive"
# Then execute function:
# fact(30000)
View tumblrGists.js
var gistPrefix = 'https://gist.github.com/',
// Cache document.write so that it can be restored once all Gists have been
// embedded.
cachedWrite = document.write,
body = $('body'),
// Map each p.gist to an object that contains the paragraph to be replaced
// and the Gist's identifier.
gists = $('a.gist').map(function(n, a) {
a = $(a);
var href = a.attr('href');
@behrends
behrends / private.xml
Created Jul 5, 2012
Easy access to Umlauts on MacOS X using KeyRemap4MacBook
View private.xml
<?xml version="1.0"?>
<root>
<item>
<name>Easy access for Umlauts</name>
<identifier>private.easy_umlaut_access</identifier>
<autogen>
--KeyToKey--
KeyCode::A, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L,
KeyCode::U, ModifierFlag::OPTION_L, KeyCode::A, ModifierFlag::SHIFT_L
</autogen>
You can’t perform that action at this time.