Skip to content

Instantly share code, notes, and snippets.

@akey7
akey7 / sine_to_sounddevice.py
Created June 28, 2020 20:22
Plays a sine wave generated in NumPy to the sound device.
# Use the sounddevice module
# http://python-sounddevice.readthedocs.io/en/0.3.10/
import numpy as np
import sounddevice as sd
import time
# Samples per second
sps = 44100
@lopspower
lopspower / README.md
Last active May 11, 2024 17:48
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@YPermitin
YPermitin / Установка и настройка выделенного сервера Valheim на Ubuntu 20.04.md
Last active May 11, 2024 17:46
Инструкция по установке игрового сервера Valheim на Ubuntu 20.04 + полезная информация по теме.

Установка и настройка выделенного сервера Valheim на Ubuntu 20.04

Простейшая инструкция по настройке сервера Valheim на Ubuntu 20.04 и полезные ссылки.

Настройка портов

Должны быть открыты порты по UDP:

import React, { useState, useEffect } from "react";
import "./styles.css";
const data = [
{ id: 1, name: "Marco" },
{ id: 2, name: "Lincoln" },
{ id: 3, name: "Aya" }
];
export default function App() {
@M0r13n
M0r13n / doh
Last active May 11, 2024 17:43
Setup Cloudflare as a DoH (DNS over HTTPS) resolver on Mikrotik devices (RouterOS v7.0.2+)
# Temporarily add a normal upstream DNS resolver
/ip dns set servers=1.1.1.1,1.0.0.1
# CA certificates extracted from Mozilla
/tool fetch url=https://curl.se/ca/cacert.pem
# Import the downloaded ca-store (127 certificates)
/certificate import file-name=cacert.pem passphrase=""
# Set the DoH resolver to cloudflare
@stecman
stecman / _readme.md
Last active May 11, 2024 17:42
Brother P-Touch PT-P300BT bluetooth driver python

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

@mbebar
mbebar / Stability_Control.m
Created November 15, 2017 07:49
MATLAB - Aircraft Stability & Control
%**************************************************************************
% AENG 4400 - Stability & Control
% Final Project - Fall 2016
%**************************************************************************
%
%
%
% "Will Engineer for coffee"
%
% ...not kidding. Please send coffee ASAP (Espresso Preferred)
@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active May 11, 2024 17:33 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@mokoshalb
mokoshalb / Office_kms
Created July 4, 2019 05:36 — forked from CHEF-KOCH/KMS_office.cmd
KMS server Windows
cd\Program Files\Microsoft Office\Office16
cd\Program Files (x86)\Microsoft Office\Office16
cscript OSPP.VBS /sethst:kms.digiboy.ir
cscript OSPP.VBS /actcscript OSPP.VBS /dstatus
slmgr.vbs /ckms
@mehmetsefabalik
mehmetsefabalik / nginx-https-local.md
Last active May 11, 2024 17:25
Enable https on your local environment with nginx

enable https on your local environment

install mkcert and create certificates

brew install mkcert
mkcert -install