Skip to content

Instantly share code, notes, and snippets.

@massimilianochiodi
massimilianochiodi / calculatecrt.swift
Created May 5, 2022 07:18
Calculate CRC CCITT Swift 5
/// Calcola il crc16 ( CRC-CCITT ) di un array di bytes nella rappresentazione UInt8
///
/// - Parameters:
/// - input: Array di UInt8
/// - Returns: valore in due bytes in formato UInt16
public func getCRC(input : [UInt8]) -> UInt16 {
if input.count == 0 { return 0 }
var crc: UInt16 = 0xFFFF; // initial value
let polynomial: UInt16 = 0x1021; // 0001 0000 0010 0001 (0, 5, 12)
@itstartstosnow
itstartstosnow / SysPropProxy.java
Created January 6, 2022 07:40
Get/set Android SystemProperties
package com.sylvia.gist;
import android.util.Log;
import java.lang.reflect.Method;
public class SysPropProxy {
private static final String TAG = "SysPropProxy";
@codephilosopher
codephilosopher / sample.go
Created October 30, 2021 18:27
go exec.Command
package main
import (
"log"
"os"
"os/exec"
)
func main() {
cmd1 := exec.Command("gcc", "-o", "sample", "golang/experiment/sample.c")
@hugo-adword
hugo-adword / StatusBar.java
Created August 5, 2021 08:57
StatusBar.java modified (will delete soon)
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
//------------------------------------------------------------------------
// Author: The SwiftUI Lab
// Post: Advanced SwiftUI Animations - Part 4
// Link: https://swiftui-lab.com/swiftui-animations-part4 (TimelineView)
//
import SwiftUI
struct ContentView: View {
var body: some View {
@NSWG
NSWG / VMware Workstation 16 Pro and Player keys
Last active July 22, 2024 13:26
VMware Workstation 16 Pro and Player keys
VMware Workstation Pro 16.x Serials
YA7RA-F6Y46-H889Z-LZMXZ-WF8UA
ZV7HR-4YX17-M80EP-JDMQG-PF0RF
UC3XK-8DD1J-089NP-MYPXT-QGU80
GV100-84W16-M85JP-WXZ7E-ZP2R6
YF5X2-8MW91-4888Y-DNWGC-W68TF
AY1XK-0NG5P-0855Y-K6ZXG-YK0T4
VMware Workstation Player 16.x Serials
@Tythos
Tythos / WasmThread-v1.0.0.js
Last active January 15, 2022 13:01
WasmThread-v1.0.0.js
/**
* @file
*
* Single-file JavaScript module that defines a developer-friendly interface
* for adapting, and calling, WASM modules in a threaded manner using
* WebWorkers. There are two components merged within this single file:
*
* 1. The first "if" block is evaluated by the WebWorker (child thread). This
* block is responsible for instantating the WASM module referenced by the
* main thread, and then managing the individual calls. This includes
package com.example.bmradio
import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.core.view.WindowCompat
# This is will be called by bitbucket pipeline
echo "Deploy script started"
cd /var/www/
sh pull.sh
echo "Deploy script finished execution."
@zinwalin
zinwalin / jetson_nano_commands.md
Last active April 5, 2021 06:34
Regular commands used in daily learning life.

no fuss, no muss...

zsh env setup

sudo apt update -y
sudo apt install zsh -y
chsh -s /bin/zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh