Skip to content

Instantly share code, notes, and snippets.

View alexrintt's full-sized avatar

Alex alexrintt

View GitHub Profile
@barseghyanartur
barseghyanartur / how to write a valentine's day message in rust.md
Last active July 29, 2023 20:12
How to write a Valentine's Day message using Stable Diffusion and Rust

How to write a Valentine's Day message using Stable Diffusion and Rust

A practical guide

Step 1

Use your favorite search engine to search for "stable diffusion image generator". You will find a lot of services. Pick one, for example Night Cafe Creator.

Step 2

@vganin
vganin / FlexRow.kt
Last active April 28, 2024 06:08
Jetpack Compose simple flex-wrap container
@Composable
fun FlowRow(
horizontalGap: Dp = 0.dp,
verticalGap: Dp = 0.dp,
alignment: Alignment.Horizontal = Alignment.Start,
content: @Composable () -> Unit,
) = Layout(content = content) { measurables, constraints ->
val horizontalGapPx = horizontalGap.toPx().roundToInt()
val verticalGapPx = verticalGap.toPx().roundToInt()
@iznaut
iznaut / readme.txt
Created February 24, 2021 23:56
A Snowball's Chance in Hell (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@Te-k
Te-k / pdf_metadata.md
Created November 26, 2020 10:31
How to remove metadata from PDFs

Many tools do not fully remove metadata, but just remove the link with in the metadata table. The data are thus still available in the PDF file itself.

While a lot of people rely on Exiftool to remove metadata, it actually does the same in PDFs. If you remove metadata with exiftool -all= some.pdf, you can always restore the data with exiftool -pdf-update:all= some.pdf.

There are several options to remove PDF metadata safely:

Option 1 : Exiftool with qpdf

  • Remove metadata with exiftool : exiftool -all= some.pdf
  • Then remove ununsed objects with qpdf : qpdf --linearize some.pdf - > some.cleaned.pdf
@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active May 1, 2024 21:12
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

@kneeprayer
kneeprayer / Invert-Image.ps1
Last active August 13, 2022 13:42
Invert Color Of An Image Using Powershell
#
# Usage : .\Invert-Image.ps1 .\test*.png
#
[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | Out-Null
Get-ChildItem $args[0] | ForEach-Object {
$image = New-Object System.Drawing.Bitmap($_.fullname)
for ($y = 0; $y -lt $image.Height; $y++) {
for ($x = 0; $x -lt $image.Width; $x++) {
$pixelColor = $image.GetPixel($x, $y)
$varR = 255 - $pixelColor.R
1. Download latest apktool version.
2. Download the batch file and aapt.exe.
3. Create a folder anywhere in the PC and put all the apktool.jar, aapt.exe and the batch script in that folder.
4. Open command prompt.
5. Navigate to the folder where you placed apktool.jar, batch script and the aapt.exe.
6. Now, you need to install the file using the " IF " command.
7. Type the following command.
apktool if name-of-the-app.apk
@letsar
letsar / variable_sized_grid_view.dart
Last active January 31, 2023 22:54
VariableSizedGridView for Flutter (Masonry style)
import 'dart:math' as math;
import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
/// Signature for a function that creates a [TileSize] for a given index.
typedef TileSize IndexedTileSizeBuilder(int index);
/// Creates grid layouts with a fixed number of spans in the cross axis.
@DasWolke
DasWolke / microservice bots.md
Last active March 23, 2024 16:41
Microservice bots

Microservice Bots

What they are and why you should use them

Introduction

Recently more and more chatbots appear, the overall chatbot market grows and the platform for it grows as well. Today we are taking a close look at what benefits creating a microservice chatbot on Discord - (a communication platform mainly targeted at gamers) would provide.

The concepts and ideas explained in this whitepaper are geared towards bots with a bigger userbase where the limits of a usual bot style appear with a greater effect

Information about Discord itself

(If you are already proficient with the Discord API and the way a normal bot works, you may skip ahead to The Concept)

@n1ru4l
n1ru4l / index.js
Created August 7, 2017 10:47
Fetch blob and convert to base64
export const fetchAsBlob = url => fetch(url)
.then(response => response.blob());
export const convertBlobToBase64 = blob => new Promise((resolve, reject) => {
const reader = new FileReader;
reader.onerror = reject;
reader.onload = () => {
resolve(reader.result);
};
reader.readAsDataURL(blob);