Skip to content

Instantly share code, notes, and snippets.

@vinthewrench
vinthewrench / testshunt.c
Created February 9, 2022 22:58
Using gattlib to read values from victron smart shunt bluetooth
/*
clang++ -Wall -o testshunt testshunt.c /usr/lib/libgattlib.so
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include "gattlib.h"
@wojteklu
wojteklu / clean_code.md
Last active May 8, 2024 20:04
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

using UnityEngine;
using System.Collections.Generic;
[RequireComponent(typeof(MeshRenderer))]
[RequireComponent(typeof(MeshFilter))]
public class GridMesh : MonoBehaviour
{
public int GridSize;
void Awake()
{
"version": 1,
"snippets": [
{
"version": 1,
"javascript": "const settings \u003d {\\r\\n chatGpt: {\\r\\n \\/\\/ replace with your ChatGPT API key created at https:\\/\\/platform.openai.com\\/api-keys\\r\\n apiKey: \\\u0027ENTER CHATGPT API KEY\\\u0027,\\r\\n\\r\\n \\/\\/ the OpenAI model to use\\r\\n model: \\\u0027gpt-4-turbo\\\u0027,\\r\\n },\\r\\n alsoAsked: {\\r\\n \\/\\/ replace with your AlsoAsked API key created at https:\\/\\/alsoasked.com\\/developer\\/keys\\r\\n apiKey:\\r\\n \\\u0027ENTER ALSOASKED API KEY\\\u0027,\\r\\n\\r\\n \\/\\/ the language to search in\\r\\n language: \\\u0027en\\\u0027,\\r\\n\\r\\n \\/\\/ the region to search in\\r\\n region: \\\u0027gb\\\u0027,\\r\\n\\r\\n \\/\\/ the depth of the search\\r\\n \\/\\/ 2 is the default and returns the smallest number of questions, and costs 1 credit\\r\\n \\/\\/ 3 is the maximum and returns the largest number of questions, but costs 4 credits\\r\\n depth: 2,\\r\\n\\r\\n
@stellanhaglund
stellanhaglund / Dockerfile
Created April 22, 2020 18:38
Assembly socket server
FROM alpine as builder
RUN apk add --no-cache build-base nasm
COPY . .
RUN nasm -f elf64 -o server.o server.s && ld server.o -o server
FROM alpine
COPY --from=0 /server /server
CMD /server $PORT
@WuStangDan
WuStangDan / course_info.txt
Last active May 8, 2024 19:58
Course Info
Complete ROS Start Guide - Windows/Mac/Linux - C++/Python
Publish Date: 02/2021
Course Link:
Course VM Download: https://drive.google.com/file/d/1gLoLCgwuvMqX1yfecyg7vo3aumWJmqT9/view?usp=sharing
Virtual Box: https://www.virtualbox.org/
Autonomous Robots: Localization
Publish Date: 07/2020
Course Link: https://www.udemy.com/course/autonomous-robots-localization/
Package Requirements: python=3.7.4 numpy=1.16.4 matploblib=3.1.0
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@etiennetremel
etiennetremel / README.md
Last active May 8, 2024 19:57
Simple Wireguard setup as VPN server and multiple clients

Simple WireGuard configuration

1 server, 2 clients

Getting started

Install Wireguard on all machines.

Generate all keys

@dasdo
dasdo / GIT.md
Last active May 8, 2024 19:55
Lista de Comandos en GIT

Configuración Básica

Configurar Nombre que salen en los commits

	git config --global user.name "dasdo"

Configurar Email

	git config --global user.email dasdo1@gmail.com
@mloskot
mloskot / cheat-tmux.markdown
Created December 14, 2012 13:11
tmux key bindings cheat shee

$ cheat tmux

Managing tmux sessions

$ tmux      # start tmux server
$ tmux at   # attach running sessions to a terminal
$ tmux ls # list running tmux sessions