Skip to content

Instantly share code, notes, and snippets.

import websockets.*;
WebsocketClient wsc;
WebsocketServer ws;
int x, y;
int role = 2;
void setup() {
size(400, 400);
if (role == 1)
import websockets.*;
WebsocketServer ws;
ArrayList<String> nachrichten;
boolean newMessages = false;
void setup(){
nachrichten = new ArrayList<String>();
ws = new WebsocketServer(this, 9000, "/chat");
}
import websockets.*;
WebsocketClient wc;
ArrayList<String> nachrichten;
boolean newMessages = false;
String toSend;
boolean ready = false;
String name = "user";
void setup() {
int jetzt;
int bildTimer;
void setup(){
erstelle();
}
void draw(){
if (!File.Exists("benchmark.bin")) {
PerformanceMark newBenchmark = Connector.DoBenchmark();
File.WriteAllBytes("benchmark.bin", Connector.SaveBenchmark());
} else {
Connector.LoadBenchmark(File.ReadAllBytes("benchmark.bin"));
}
function keepNumbers(mixedarray){
//create empty array to store the numbers in
let numberarray = [];
//for each element in the array call the anonymous function...
mixedarray.forEach(
//... right here
function(element) {
//check if the element type is "number"
public class Main {
public static void main(String[] args) {
System.out.println("fakuiter ist: " + fakuIter(4));
System.out.println("fakureku ist: " + fakuReku(4));
}
static int fakuIter(int n){
int ergebnis = 1;
for (int i = 1; i <= n; i++) {
# Init Prompt and completion
autoload -U compinit promptinit
compinit
promptinit
export EDITOR=nano
#aliases
source ~/.zsh_aliases
# we don't need a history in less #############################################

Arduino Connection on NixOS

First we need lsusb command from the usbutils package.

> nix-env -i usbutils
> lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 011: ID 0403:6001 FTDI FT232 USB-Serial (UART) IC
@cheriimoya
cheriimoya / contact_filter.py
Created March 29, 2020 09:22
contact_filter.py <contacts.csv>
from sys import argv
import vobject
with open(argv[1]) as f:
contacts_object = vobject.readComponents(f)
contacts = []
try:
while True: