Skip to content

Instantly share code, notes, and snippets.

View DanielMSchmidt's full-sized avatar
🚀
Working on Terraform Core

Daniel Schmidt DanielMSchmidt

🚀
Working on Terraform Core
View GitHub Profile
@DanielMSchmidt
DanielMSchmidt / weighted grade point average
Last active January 1, 2016 06:19
If you paste this script into your chrome developer console or firebug console while visiting the StudiDB of the CAU you get the weighted grade point average.
(function(){
var rows = document.querySelectorAll('tr');
var row, note, module, ects, sumects = 0, summe = 0, divisor = 0;
var base = ["Inf-Math-A", "Inf-Prog", "Inf-DigiSys", "Inf-DSys", "Inf-EinfPP", "Inf-ADS", "Inf-OAR", "Inf-Math-B", "Inf-PP"];
for(var i = 0, len = rows.length; i < len; i++){
row = rows[i];
module = row.querySelectorAll('.f1:nth-of-type(2)');
note = row.querySelectorAll('.f1:nth-of-type(3)');
ects = row.querySelectorAll('.f1:nth-of-type(4)');
if (note.length && ects.length){
@DanielMSchmidt
DanielMSchmidt / gist:f5767f450e02911f8a4a
Last active August 29, 2015 14:15
KoLei Formelsammlung
\documentclass[12pt, a4paper]{article}
\usepackage{url,graphicx,tabularx,array,geometry}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
@DanielMSchmidt
DanielMSchmidt / gist:b3e8fd401b9df3e83039
Last active August 29, 2015 14:23
Safe-touch mixin (works with sass >= 3.4 & modernizr)
@mixin safe-hover {
@at-root #{selector-append("html.no-touch", &, ":hover")} {
@content;
}
}
@DanielMSchmidt
DanielMSchmidt / 0_es5.js
Last active April 13, 2016 20:19
deconstructing
var Image = React.Image;
var View = React.View;
var Component = React.Component;
var Text = React.Text;
function search(needle, haystack, limit) {
//...
}
// Some modules later
// Doh' wrong
// search('3.1415926', 1, '.');
// Damn it, which order was it again?
// search('3.1415926', '.' , 1);
@DanielMSchmidt
DanielMSchmidt / 0_es5.js
Last active April 13, 2016 20:19
optional function parameters
function foo(a,b,c,d,e) {
//...
}
// place a
foo(1,2,3,undefined,5);
// place b
foo(1,2,3,4);
var Constructor = function() {
this.promise = myPromiseLib();
this.onEventCallback = function(e) {
return this.promise.resolve(e.name);
}.bind(this);
return this;
}
var item = new Constructor();
item.promise.then(function(result) {
@DanielMSchmidt
DanielMSchmidt / LoginForm.js
Last active May 12, 2016 14:42
redux-form + autofill
@reduxForm({
form: 'login',
fields: ['email', 'password'],
validate: validation // email and password are both required
})
class LoginForm extends Component {
static propTypes = {
fields: PropTypes.object.isRequired,
handleSubmit: PropTypes.func.isRequired,
}
@DanielMSchmidt
DanielMSchmidt / LoginForm.js
Created April 14, 2016 08:13
redux-form + autofill
@reduxForm({
form: 'login',
fields: ['email', 'password'],
validate: validation // email and password are both required
})
class LoginForm extends Component {
static propTypes = {
fields: PropTypes.object.isRequired,
handleSubmit: PropTypes.func.isRequired,
}
@DanielMSchmidt
DanielMSchmidt / index.android.js
Created April 14, 2016 08:35
react native init bar with react-native: 0.23.1
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
import React, {
AppRegistry,
Component,
StyleSheet,
Text,