Skip to content

Instantly share code, notes, and snippets.

View rayros's full-sized avatar
🏝️

Paweł Łaski rayros

🏝️
View GitHub Profile
@rayros
rayros / traefik-config.yaml
Created November 6, 2024 00:20
Fix k3s traefik 499 Client Closed Request for long upload
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: traefik
namespace: kube-system
spec:
valuesContent: |-
additionalArguments:
- "--entrypoints.web.transport.respondingTimeouts.readTimeout=3600" # 1 hour
- "--entrypoints.websecure.transport.respondingTimeouts.readTimeout=3600" # 1 hour
@rayros
rayros / index.js
Last active September 23, 2020 06:57
#!/usr/bin/env node
const puppeteer = require('puppeteer');
const pixel2 = puppeteer.devices['Pixel 2'];
const args = process.argv.slice(2);
const login = process.env.NC_LOGIN;
const password = process.env.NC_PASSWORD;
const domain = args[0];
const record = args[1];
// tslint:disable: no-reference
/// <reference path="../../../node_modules/@types/gapi/index.d.ts" />
/// <reference path="../../../node_modules/@types/gapi.client/index.d.ts" />
/// <reference path="../../../node_modules/@types/gapi.client.drive/index.d.ts" />
import { Injectable, NgZone } from '@angular/core';
import * as debug from 'debug';
import { bindCallback, Observable, OperatorFunction } from 'rxjs';
import { map, switchMap, take } from 'rxjs/operators';
import { GAPIService } from './gapi.service';
@rayros
rayros / minimum-description-length-principle.ts
Created June 25, 2018 22:04
Minimum description length
import * as nj from 'numjs';
interface Level {
start: number;
end: number;
depth: number;
}
export class MinimumDescriptionLengthPrinciple {
@rayros
rayros / chromium-browser.service
Created July 10, 2017 00:14
chromium-browser headless
[Unit]
Description=chromium-browser headless
[Service]
Type=simple
ExecStart=/usr/bin/chromium-browser --headless --disable-gpu --remote-debugging-port=9222
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=chromium-browser
@rayros
rayros / ubuntu14.04-command-line-install-android-sdk
Last active June 5, 2017 18:58 — forked from wenzhixin/ubuntu14.04-command-line-install-android-sdk
Ubuntu 14.04 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
#!/bin/bash
release_code=$(. /etc/lsb-release && echo "$DISTRIB_CODENAME")
key="ABF5BD827BD9BF62"
echo -e "deb http://nginx.org/packages/ubuntu/ $release_code nginx\ndeb-src http://nginx.org/packages/ubuntu/ $release_code nginx" > /etc/apt/sources.list.d/nginx.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key
navigator.getUserMedia = navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia;
function supportsTransitions() {
var b = document.body || document.documentElement,
s = b.style,
p = 'transition';
if (typeof s[p] == 'string') { return true; }
// Tests for vendor specific prop
var v = ['Moz', 'webkit', 'Webkit', 'Khtml', 'O', 'ms'];
p = p.charAt(0).toUpperCase() + p.substr(1);
for (var i=0; i<v.length; i++) {
if (typeof s[v[i] + p] == 'string') { return true; }
function getPosition(element) {
var xPosition = 0, yPosition = 0;
while(element) {
xPosition += (element.offsetLeft - element.scrollLeft + element.clientLeft);
yPosition += (element.offsetTop - element.scrollTop + element.clientTop);
element = element.offsetParent;
}
return { x: xPosition, y: yPosition };
}