Skip to content

Instantly share code, notes, and snippets.

View tecteun's full-sized avatar
💭
🤠

tecteun

💭
🤠
View GitHub Profile
@tecteun
tecteun / utc.sh
Created November 22, 2024 10:05
UTC timestamps unix
date -u +"%Y-%m-%dT%H:%M:%S.000"
#Shows current UTC
date -u --date="+30 seconds" +"%Y-%m-%dT%H:%M:%S.000"
#Shows current UTC +30sec
date -u --date="-30 seconds" +"%Y-%m-%dT%H:%M:%S.000"
#Shows current UTC -30sec
@tecteun
tecteun / ip.js
Created June 15, 2023 11:21
get ip js
var now = Date.now();
var s = document.createElement('script'); s.onload = s.onerror = () => s.parentElement.removeChild(s);
window[`_ip_${now}`] = (_) => console.log(_.data.ip);
s.src = `https://stat.ripe.net/data/whats-my-ip/data.json?callback=_ip_${now}`;
document.body.appendChild(s)
@tecteun
tecteun / corsproxypatch.patch
Created August 8, 2022 10:02
flutter tool cors patch
diff --git a/packages/flutter_tools/lib/src/isolated/devfs_web.dart b/packages/flutter_tools/lib/src/isolated/devfs_web.dart
index e9fd1d07b6..5e6c648962 100644
--- a/packages/flutter_tools/lib/src/isolated/devfs_web.dart
+++ b/packages/flutter_tools/lib/src/isolated/devfs_web.dart
@@ -17,6 +17,7 @@ import 'package:mime/mime.dart' as mime;
import 'package:package_config/package_config.dart';
import 'package:shelf/shelf.dart' as shelf;
import 'package:shelf/shelf_io.dart' as shelf;
+import 'package:shelf_proxy/shelf_proxy.dart';
import 'package:vm_service/vm_service.dart' as vm_service;
@tecteun
tecteun / main.dart
Last active July 12, 2022 09:40
scrolling ribbon
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
@tecteun
tecteun / main.dart
Last active May 3, 2022 13:16
big scroll test
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(
MyApp(
items: List<String>.generate(130, (i) => 'Item $i'),
),
);
}
@tecteun
tecteun / unosyncer.ino
Created February 1, 2021 23:07
DIY Arduino Eurorack clock divider / multiplier using interrupt
// Timer library, https://github.com/dniklaus/wiring-timer,
// add it by using the Arduino IDE Library Manager (search for wiring-timer)
#include <Timer.h>
// LcdKeypad, https://github.com/dniklaus/arduino-display-lcdkeypad,
// add it by using the Arduino IDE Library Manager (search for arduino-display-lcdkeypad)
#include <LcdKeypad.h>
@tecteun
tecteun / steam.sh
Last active December 26, 2020 19:15
steam proton config stash
# Improving proton performance:
# https://www.protondb.com/help/improving-performance
# Feral Gamemode:
# https://launchpad.net/~samoilov-lex/+archive/ubuntu/gamemode
ENABLE_VK_LAYER_VALVE_steam_fossilize_1=1 DXVK_STATE_CACHE=0 PROTON_NO_GLSL=0 PROTON_USE_D9VK=1 PROTON_NO_ESYNC=0 DXVK_ASYNC=1 %command% --waitforpreload --noasync --nodx9ex --gc2 --nologo
@tecteun
tecteun / levenshtein.js
Created October 23, 2020 11:53
levenshtein distance
// https://en.wikipedia.org/wiki/Levenshtein_distance
function lv(A, B) {
// create two work vectors of integer distances
let v0 = new Array(A.length);
let v1 = new Array(B.length);
// initialize v0 (the previous row of distances)
// this row is A[0][i]: edit distance for an empty s
// the distance is just the number of characters to delete from t
for(let i = 0; i <= B.length + 1; i++){
v0[i] = i;
@tecteun
tecteun / run_firefox_debug.sh
Created April 14, 2020 07:32
Firefox MediaSource debugging
NSPR_LOG_MODULES=MediaSource:5,MediaSourceSamples:5,MediaFormatReader:5 /Applications/Firefox.app/Contents/MacOS/firefox
@tecteun
tecteun / fix_throttling_when_idle.md
Last active December 28, 2020 11:06
Ubuntu studio / realtime audio processing (Intel(R) Core(TM) i7 CPU 870)

Gist:

throttling does not go well with realtime audio processing (resulting in a popcorn audio stream)

Having audio issues? Double check if u r throttling!!

see real live cpu frequency

watch grep \"cpu MHz\" /proc/cpuinfo