Skip to content

Instantly share code, notes, and snippets.

View m1m1s1ku's full-sized avatar
🌀

Léonard. m1m1s1ku

🌀
View GitHub Profile
@m1m1s1ku
m1m1s1ku / konami.ts
Last active September 6, 2022 08:29
Konami RxJS 7
const table: {[key: string]: number} = {
ArrowUp: 38,
ArrowDown: 40,
ArrowLeft: 37,
ArrowRight: 39,
KeyB: 66,
// Azerty compat
KeyQ: 65,
KeyA: 65,
};
@m1m1s1ku
m1m1s1ku / nginx.conf
Last active September 2, 2022 02:04
Nginx vhost redirect to another host
server {
listen 80;
# Change domain
server_name domain.tld;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
@m1m1s1ku
m1m1s1ku / nginx.conf
Last active September 2, 2022 01:55
Nginx config VHost PhpBB 8.1 (Debian 11 Bullseye)
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name _;
ssl_certificate /etc/nginx/ssl/phpbb.local.crt;
{"schemaVersion":1,"label":"Coverage","message":"100%","namedLogo":"typescript"}
@m1m1s1ku
m1m1s1ku / backup.php
Created June 17, 2022 23:28
db backup sftp
<?php
// DB Backup
set_time_limit(500);
$success = false;
$localPath = './tmp/';
$database['db_user'] = 'xxx';
$database['db_password'] = 'xxx';
$database['db_name'] = 'xxx';
interface Point {
angle: number;
multiplicator: number;
x: number;
y: number;
}
function randomValue(min: number, max: number){
return Math.floor(min + Math.random()*(max + 1 - min));
}
@m1m1s1ku
m1m1s1ku / widevine.md
Last active August 5, 2019 20:36
Widevine (Netflix...) on ChromiumOS
@m1m1s1ku
m1m1s1ku / FixAudioChromiumOS.md
Last active August 4, 2019 22:18
Debug audio on ChromiumOS (or Generic linux tablet)

Fix broken audio on ChromiumOS

Fix commands :

  • Ctrl + Alt + T

  • shell

  • cras Check output if any errors, you are good to find config files.

  • If something is missing, go on https://github.com/plbossart/UCM to find missing files (or elsewhere.)

  • Boot under Ubuntu or another live usb to put files at the correct place

This file has been truncated, but you can view the full file.
#!/bin/bash
# This script was initially based on the information documented on the following sites:
# https://help.ubuntu.com/community/LiveCDCustomization (shared under a Creative Commons Attribution-ShareAlike 3.0 License available at https://help.ubuntu.com/community/License)
# https://wiki.ubuntu.com/KernelTeam/GitKernelBuild (shared under a Creative Commons Attribution-ShareAlike 3.0 License available at https://help.ubuntu.com/community/License)
# and then further developed by Linuxium (linuxium@linuxium.com.au).
# Version 1: This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
# Version 2.01.050417: This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 License.
# Version 3.01.120417: This work is licensed under GNU GPL version 3 under one-way compatibility with CC BY-SA 4.0.
# Version 3.02.130417, 4.06.220417 to 4.09.280417, 5.01.020517, 6.01.120517, 6.02.0 to 6.03.3, 7.1.0 to 7.3.5.1, 7.3.6, 8.0.0 to 8.2.7: This work is licensed under GNU GPL version
@m1m1s1ku
m1m1s1ku / debounceTimeJustWhy.ts
Created April 26, 2019 17:40
DebounceTime(0) is BAD
// Write any JavaScript you want, just make sure that
// the last expression is an Rx.Observable
const { asapScheduler, animationFrameScheduler, asyncScheduler, queueScheduler, merge, EMPTY } = Rx;
const { map, debounceTime, startWith, filter } = RxOperators;
// New macro-task (long-running task)
const asyncScheduler$ = EMPTY.pipe(
startWith('async', asyncScheduler)
)