Skip to content

Instantly share code, notes, and snippets.

View x1unix's full-sized avatar
:shipit:
Work in progress

Denys Sedchenko x1unix

:shipit:
Work in progress
View GitHub Profile
@Quarx2k
Quarx2k / gist:a96dd95f2d71b9d478280690cb6098c8
Last active October 21, 2021 10:41
Oneplus 7Pro 48M Mode Enabler
private int[] getSensorsModeTable(CameraCharacteristics characteristics) {
//OP7 Pro return. Used by video recording.
//Sensor modes: [9, 3, 4000, 3000, 30, 4000, 3000, 30, 4000, 3000, 60, 2000, 1128, 240, 1296, 736, 480, 2000, 1500, 120, 4000, 3000, 23, 4000, 3000, 30, 8000, 6000, 21]
Constructor<CameraCharacteristics.Key> cameraCharacteristicsConstructor;
try {
cameraCharacteristicsConstructor = CameraCharacteristics.Key.class.getDeclaredConstructor(String.class, Class.class);
cameraCharacteristicsConstructor.setAccessible(true);
CameraCharacteristics.Key KEY_SENSOR_MODE_TABLE =
cameraCharacteristicsConstructor.newInstance("org.quic.camera2.sensormode.info.SensorModeTable", int[].class);
@amake
amake / innosetup-linux-macos.org
Last active May 22, 2024 06:31
Inno Setup on Linux and macOS

Inno Setup on Linux and macOS

Inno Setup is a popular installer builder for Windows. Of course it is made to run on Windows only, by default. But what if you want to build Windows installers off Windows, i.e. on Linux or macOS?

You’re in luck: It’s possible to run Inno Setup anywhere that Docker runs (including Linux and macOS), and even have a passable experience writing your setup script.

@irustm
irustm / AngularVsReact.md
Last active April 8, 2024 09:47
Angular vs React

На случай важных переговоров

[11.01.18 18:47] [Forwarded from Алексей Охрименко]

  1. Google, Microsoft
  2. Typescript из коробки
  3. Единственный вреймворк с Dependency Injection из коробки
  4. Не нужно ничего React-ить и AngularJS-ифаить. Больше никаких оберток. jQuery плагины и D3 можно использовать на прямую
  5. Более современный фреймворк
@mag911
mag911 / Parallel_Tools_fix_for_Ubuntu_19.04.md
Last active May 24, 2024 12:45
Parallel Tools fix for Ubuntu 20.04, 19.04, 19.10, 18.04

Update 25 April 2020:

Many thanks to @KZL1992 @tomslominski @ptrofi @n-thumann for recent comments on their experiences with 20.04 and Parallels 13/14/15, especially the subsitution of the latest prl-tools-lin.iso for older Parallels to get it going.


First off, credit goes to github.com/rudolfratusinski for leading the way here.

https://gist.github.com/rudolfratusinski/a4d9e3caff11a4d9d81d2e84abc9afbf

@phemmer
phemmer / defer.sh
Last active March 5, 2024 09:55
bash defer function - just like go's defer()
function _run_deferred() {
local _depth="$BASHPID.${#FUNCNAME[@]}"
[[ "$_depth" != "$_deferred_depth" ]] && return
local opt=$-
set +e
for (( i=${#_deferred[@]} - 1; i >= 0; i-- )); do
eval "${_deferred[i]}"
done
[[ "$opt" == *e* ]] && set -e
}
@thephez
thephez / json-rpc-oas-example.json
Created December 4, 2018 17:33
Example of describing JSON-RPC 2.0 API with OpenAPI
{
"x-send-defaults": true,
"openapi": "3.0.0",
"x-api-id": "json-rpc-example",
"info": {
"title": "JSON-RPC OpenAPI",
"version": "1.0.0",
"description": "Example of how to describe a JSON-RPC 2 API in OpenAPI"
},
"servers": [
@korakot
korakot / draw.py
Last active May 17, 2024 03:38
Drawing on Google Colab
from IPython.display import HTML, Image
from google.colab.output import eval_js
from base64 import b64decode
canvas_html = """
<canvas width=%d height=%d></canvas>
<button>Finish</button>
<script>
var canvas = document.querySelector('canvas')
var ctx = canvas.getContext('2d')
# Installation on Dell XPS 9570
# Connect to Internet
wifi-menu
# Sync clock
timedatectl set-ntp true
# Create three partitions:
@ptkdev
ptkdev / android-restore-password-keystore-jks.md
Last active March 28, 2023 15:51
Android: Recovery lost keystore jks file or keystore password

Sign android app with new keystore file if you missing password or lost jks file.

  1. Create new keystore.jks file with comand line (not android studio build menu)

    Linux: keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks

    Windows: "C:\Program Files\Android\Android Studio\jre\bin\keytool.exe" -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore "C:\keystore_new.jks"

  2. Generate a .pem file from new keystore

@panta
panta / logging.go
Last active May 27, 2024 16:37
zerolog with file log rotation (lumberjack) and console output
package logging
import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"gopkg.in/natefinch/lumberjack.v2"
"os"
"path"
"io"
)