Skip to content

Instantly share code, notes, and snippets.

barron9 / wakefix.service
Last active May 5, 2023 13:33
ubuntu 22.04 a4tech fstyler wireless keyboard wake fix service
View wakefix.service
Description=Run script after screen unlock/wake
barron9 /
Last active March 17, 2023 10:39
generative network with dense layers
from keras.models import Model
from keras.layers import Input, Dense
from keras.optimizers import Adam
# Define the input layer
inputs = Input(shape=(784,))
# Define the hidden layers
hidden1 = Dense(128, activation='relu')(inputs)
hidden2 = Dense(64, activation='relu')(hidden1)
barron9 / deadlock.c
Last active November 16, 2022 21:49
deadlock example
View deadlock.c
#include <stdio.h>
#include <pthread/pthread.h>
void* someprocess(void* arg);
void *anotherprocess(void* arg);
pthread_mutex_t lock;
pthread_t tid[2];
int counter;
int main(int argc, const char * argv[]) {
barron9 / cleanse.swift
Created October 29, 2021 16:32
View cleanse.swift
import Foundation
import Core
import Cleanse
public class FeatureX{
public init(){
// _ = CoreDummy()
let f = try! ComponentFactory.of(APIComponent.self)
RootViewController2(loggedInComponent: f)
barron9 /
Last active September 17, 2021 02:31
import java.util.ArrayList;
import java.util.List;
class Custom{
private String name;
Custom(String name){ = name;
protected void finalize(){
// System.out.println("gc'd");
class HTTPClient{
private HttpRequest request;
private HttpClient client;
private LoggerM logger;
HTTPClient(LoggerM logger) {
barron9 /
Created July 6, 2021 14:32 — forked from yosssi/
Go networking performance vs Nginx

1. Nginx

$ wrk -t12 -c400 -d2s
Running 2s test @
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     7.71ms    3.16ms  23.05ms   69.17%
    Req/Sec     3.44k     1.98k    7.80k    58.22%
  63697 requests in 2.00s, 17.86MB read
barron9 /
Created July 4, 2021 16:29 — forked from denji/
Simple Golang HTTPS/TLS Examples

Moved to git repository:

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
barron9 / main.go
Created July 4, 2021 14:50 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
View test.swift
let accounts = [BankAccount(accountNumber: 1,initialDeposit: 100),BankAccount(accountNumber: 2,initialDeposit: 100),]
let q0 = DispatchQueue(label: "queue0", attributes: .concurrent)
do {
accounts.forEach {
account in
async {
try await account.transfer(amount: 1, to: accounts[1])