Skip to content

Instantly share code, notes, and snippets.

View fabwu's full-sized avatar

Fabian Wüthrich fabwu

View GitHub Profile
#include <linux/i2c.h>
#define OV5693_REG_VALUE_08BIT 1
#define OV5693_REG_VALUE_16BIT 2
#define OV5695_REG_VALUE_24BIT 3
#define OV5693_SC_CMMN_CHIP_ID_H 0x300A
/* Read registers up to 4 at a time */
static int ov5693_read_reg(struct i2c_client *client, u16 reg, unsigned int len,
@fabwu
fabwu / install.sh
Last active September 30, 2023 16:58
dotfiles install script
#!/bin/bash
#
# dotfiles install script
#
# adapted from Nicola Paolucci
#
# https://www.atlassian.com/git/tutorials/dotfiles
REPO=git@github.com:fabwu/dot-files.git
[ 83.594281] audit: type=1106 audit(1581763351.900:66): pid=1611 uid=0 auid=1000 ses=3 msg='op=PAM:session_close grantors=pam_limits,pam_unix,pam_permit acct="root" exe="/usr/bin/sudo
" hostname=? addr=? terminal=/dev/pts/0 res=success'
[ 83.594352] audit: type=1104 audit(1581763351.900:67): pid=1611 uid=0 auid=1000 ses=3 msg='op=PAM:setcred grantors=pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? addr
=? terminal=/dev/pts/0 res=success'
[ 99.534621] PM: suspend entry (s2idle)
[ 99.542963] Filesystems sync: 0.008 seconds
[ 99.543360] Freezing user space processes ... (elapsed 0.001 seconds) done.
[ 99.544997] OOM killer disabled.
[ 99.544998] Freezing remaining freezable tasks ... (elapsed 0.000 seconds) done.
[ 99.545947] printk: Suspending console(s) (use no_console_suspend to debug)
@fabwu
fabwu / algorithm.cpp
Last active January 29, 2020 18:16
Radiation
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <limits>
#include <stdexcept>
#include <CGAL/QP_models.h>
#include <CGAL/QP_functions.h>
#include <CGAL/Gmpz.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <limits>
#include <stdexcept>
#include <CGAL/QP_models.h>
#include <CGAL/QP_functions.h>
#include <CGAL/Gmpz.h>
@fabwu
fabwu / srf-mediathek.md
Last active July 22, 2019 21:37
Videos von SRF Mediathek herunterladen

Videos von SRF Mediathek herunterladen

  1. Zu Video navigieren und Dev-Tools (Firefox) öffnen

  2. In Tab Netzwerkanalyse bei der Suche urn json eingeben und es sollte eine JSON-Datei auftauchen

  3. JSON in einem neuen Tab öffnen

  4. Nach master.m3u8 suchen und die Datei in der HD Sektion herunterladen

@fabwu
fabwu / javascript_object_pattern.js
Last active February 16, 2017 16:40
Javascript Object Pattern
function Position(constructor) {
var self = {
publicProperty: 'publicProperty',
publicFuntion1: publicFuntion1,
publicFuntion2: publicFuntion2
};
var privateProperty = 'privateProperty';
function publicFuntion1() {
var timer;
window.addEventListener('load', function () {
timer = new Timer();
update();
});
document.getElementById('inc-min').addEventListener('click', function () {
timer.incrementMinutes();
updateMinutes();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Basic HTML und CSS Manipulation</title>
</head>
<body>
<h1>Basic HTML und CSS Manipulation</h1>
<p>Erzeugen Sie eine einfache Webseite in HTML die einen oder mehrere Texte und einen Button enthält. Verändern Sie den
Inhalt oder Aussehen der Webseite, wie folgt:</p>
@fabwu
fabwu / index.php
Created November 28, 2013 17:49
index.php
<?php
$titles = array('main' => 'Startseite', 'canvas' => 'Canvas', 'formular' => 'Formular', );
$urlParts = array();
preg_match('/\/([a-z]+)\.php(\?.*)?$/', $_SERVER["REQUEST_URI"], $urlParts);
if (isset($urlParts[1]) && isset($titles[$urlParts[1]])) {
$page = $urlParts[1];
} else {
$page = 'main';
}