Skip to content

Instantly share code, notes, and snippets.

@sevaa
sevaa / ToUTF8.sql
Last active April 30, 2024 09:51
Converting an NVARCHAR string to a UTF-8 VARBINARY data block in pure Transact-SQL
create function [dbo].[ToUTF8](@s nvarchar(max))
returns varbinary(max)
as
begin
declare @i int = 1, @n int = datalength(@s)/2, @r varbinary(max) = 0x, @c int, @c2 int, @d varbinary(4)
while @i <= @n
begin
set @c = unicode(substring(@s, @i, 1))
if (@c & 0xFC00) = 0xD800
begin
@sdstrowes
sdstrowes / foo.md
Created September 1, 2017 08:04
Reverse Engineering the Speedtest.net Protocol, Gökberk Yaltıraklı

Source: https://web.archive.org/web/20141216073338/https://gkbrk.com/blog/read?name=reverse_engineering_the_speedtest_net_protocol Author: Gökberk Yaltıraklı

Reverse Engineering the Speedtest.net Protocol

After finishing my command line speed tester written in Rust, I didn't have a proper blog to document this process. A few days ago I wrapped up a simple blogging script in Python so hopefully it works good enough to explain how everything works.

By now I have already figured out the whole protocol for performing a speed test but I will write all the steps that I took so you can learn how to reverse engineer a simple protocol.

The code that I wrote can be found at https://github.com/gkbrk/speedtest-rust.

@zatarra
zatarra / brain.py
Last active April 30, 2024 09:49
Python script to parse data from Mindflex headband and convert it into a powerfull EEG device
#!/usr/bin/python
import serial
import sys
latestByte = ('c')
lastByte = ('c')
inPacket = False
myPacket = []
PLENGTH = 0
@vyv03354
vyv03354 / gist:fa60598c53e98d3e724b15344c0ebe72
Last active April 30, 2024 09:49
(ZF⁻)−3 のモデルについて

『キューネン 数学基礎論講義』の置換公理 のページの内容について質問があります。 「万有集合をもつモデルは基礎の公理 (A2) をみたさない」というのは本当でしょうか?

$A$$0$を除くすべての要素は$0$を要素に持つので、

  • $x=0$の場合:$∃y∈A(y∈_\mathfrak{A}x)$が成り立たないのでよい。
  • $x≠0$の場合:$y$として$0$を取れば$0∈_\mathfrak{A}x∧¬∃z∈A(z∈_\mathfrak{A}x∧z∈_\mathfrak{A}0)$が成り立つのでよい。

となって、A2が$\mathfrak{A}$で成り立っているように見えます。内包公理があると万有集合から自分自身のみを要素に持つ集合が作れてしまうのでだめですが、内包公理がないので問題ないはずです。

@ingridbonnet
ingridbonnet / hello.c
Created April 30, 2024 09:48
mon hello world
int main()
{
printf("Hello world");
return 0
}
From 7341a316c38a61cc745ce04e618916677007883b Mon Sep 17 00:00:00 2001
From: Timothy Brom <thb@timbrom.com>
Date: Wed, 29 Feb 2012 11:29:55 -0500
Subject: [PATCH] Fixed error about strexh and strexb using the same register
---
example/libs_stm/inc/core_support/core_cm3.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/example/libs_stm/inc/core_support/core_cm3.c b/example/libs_stm/inc/core_support/core_cm3.c
@alexeldeib
alexeldeib / manifests.yaml
Created October 22, 2021 16:01
crictl image cleanup
apiVersion: v1
kind: ConfigMap
metadata:
name: imagecleanupconfig
namespace: default
labels:
component: imagecleanup
data:
# removes all images unused by a running container
cronjobs: 0 0 * * * crictl rmi --prune 2>&1
@ishad0w
ishad0w / sources.list
Created December 10, 2021 16:36
Ubuntu 22.04 LTS (ARM/RISC-V) (Jammy Jellyfish) -- Full sources.list
deb http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted universe multiverse
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 30, 2024 09:44
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@abelsonlive
abelsonlive / dbt_backfill.py
Created April 11, 2019 02:14
Script for backfilling DBT models which use partitions
#!/usr/bin/env python
import json
import copy
import sys
import argparse
from datetime import datetime, timedelta
from subprocess import Popen, PIPE
# dictionary of partiton names to variable generating functions