Skip to content

Instantly share code, notes, and snippets.

@waynedahlberg
waynedahlberg / GlassButton.swift
Last active September 26, 2024 20:42
Glass SwiftUI Button
//
// ContentView.swift
// Glass Button
//
// Created by Wayne Dahlberg on 9/25/24.
//
import SwiftUI
struct ContentView: View {
@Petezah
Petezah / tls_client.c
Created September 9, 2024 19:02 — forked from mmozeiko/tls_client.c
simple example of TLS socket client using win32 schannel api
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <windows.h>
#define SECURITY_WIN32
#include <security.h>
#include <schannel.h>
#include <shlwapi.h>
#include <assert.h>
#include <stdio.h>
@mmozeiko
mmozeiko / tls_client.c
Last active September 27, 2024 19:55
simple example of TLS socket client using win32 schannel api
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <windows.h>
#define SECURITY_WIN32
#include <security.h>
#include <schannel.h>
#include <shlwapi.h>
#include <assert.h>
#include <stdio.h>
@fosterbrereton
fosterbrereton / better_macros_better_flags.cpp
Last active April 28, 2024 15:20
Companion source code for the article "Better Macros, Better Flags."
/*
MIT License
Copyright 2019 Foster T. Brereton
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
// should really use various NOPs here instead of while loop
#define SPOUT(x) SPDR = x; \
while (!(SPSR & _BV(SPIF))) { }
// should really use various NOPs here instead of while loop
#define SPOUT2(x) SPDR = x; \
while (!(SPSR & _BV(SPIF))) { }
// should really use various NOPs here instead of while loop
#define SPOUT3(x) SPDR = x; \
@jjvillavicencio
jjvillavicencio / setup.sh
Last active September 8, 2024 14:48
Install Android SDK on Windows Bash (WSL)
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install ubuntu-desktop build-essential git automake checkinstall gcc-6 g++-6 \
    intltool libtool \
    alsa-base alsa-utils alsa-tools libasound2 libasound2-plugins \
    libx11-dev libx11-xcb-dev check libsndfile1-dev libtdb-dev libgdbm-dev \
    libgtk-3-dev libgconf2-dev \
    libjack-dev jack libasyncns-dev libasyncns0 libwrap0-dev libwrap0 libsbc-dev libsbc1 \
    libavahi-common-dev libavahi-client3 libdbus-1-dev libssl-dev \