Skip to content

Instantly share code, notes, and snippets.

View danieldaeschle's full-sized avatar
:octocat:
Available

Daniel Däschle danieldaeschle

:octocat:
Available
View GitHub Profile
@danieldaeschle
danieldaeschle / PopupLayout.kt
Created April 16, 2023 21:40
Jetpack Compose Popup Navigator
package com.github.danieldaeschle.ministrynotes.lib
import androidx.compose.animation.core.AnimationSpec
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
@danieldaeschle
danieldaeschle / Microsoft.PowerShell_profile.ps1
Last active May 13, 2021 15:19
Powershell profile configuration
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme robbyrussel
# Helper function to change directory to development workspace
function cws { Set-Location $env:USERPROFILE\Projects }
Import-Module PSReadLine
# Shows navigable menu of all options when hitting Tab
@danieldaeschle
danieldaeschle / main.c
Created December 10, 2020 23:28
Rename function in object code
#include <stdio.h>
#include <execinfo.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
void handler(int sig) {
void *array[10];
size_t size;
@danieldaeschle
danieldaeschle / index.html
Last active June 18, 2020 11:37
selbe vs gleiche
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<label t="translate(0,346)">
from tkinter import *
import time
import numpy as np
WIDTH = 800
HEIGHT = 500
SIZE = 5
tk = Tk()
canvas = Canvas(tk, width=WIDTH, height=HEIGHT, bg="grey")
canvas.pack()
version: "3"
services:
helloworld:
image: tutum/hello-world
expose:
- "80"
labels:
- "traefik.domain=helloworld.example.com"
#include <Python.h>
PyObject *hello(PyObject *self, PyObject *args) {
printf("Hello World\n");
Py_RETURN_NONE;
}
struct PyMethodDef greeter_methods[] = {
{"hello", hello, METH_NOARGS, "Some docs..."},
{NULL, NULL, 0, NULL}
@danieldaeschle
danieldaeschle / even_or_odd.py
Created July 28, 2018 11:49
My second NN which can see if a number is even or odd
from keras.utils import to_categorical
from keras.models import Sequential
from keras.layers import Dense
from random import sample
import numpy as np
import os
# Train data (Number 0 to 99 in binary list format with maximum length of 10)
x_train = np.array(list(map(lambda x: [0 for _ in range(
10 - len(format(x[0], "b")))] + list(format(x[0], "b")), sample([[x] for x in range(100)], 100))))
@danieldaeschle
danieldaeschle / first-nn.py
Created July 27, 2018 18:13
This is my first deep learning network which detects if the number is smaller or bigger than 5 :)
from keras.utils import to_categorical
from keras.models import Sequential
from keras.layers import Dense
from random import sample
import numpy as np
x_train = np.array(sample(5 * [[x] for x in range(11)], 5 * 11))
y_train = np.array([int(x > 4) for x in x_train])
y_binary = to_categorical(y_train)