Skip to content

Instantly share code, notes, and snippets.

View ArinFaraj's full-sized avatar
💭
Focusing

Arin Abdulmajeed ArinFaraj

💭
Focusing
View GitHub Profile
@ArinFaraj
ArinFaraj / .dockerignore
Last active January 19, 2023 11:09
Good enough rust + actix web dockerfile [replace the APP_NAME]
target
Dockerfile
.dockerignore
.git
.gitignore
.env
@ArinFaraj
ArinFaraj / README.md
Last active February 1, 2023 11:28 — forked from zealot128/README.md
Gitlab Autoscaling Infrastructure on Hcloud with internal caching

Order and provision a Hetzner Cloud based Gitlab-Runner Docker-machine autoscaling infrastructure

See my blog for more information.

  • Adjust settings in vars.auto.tfvars.
  • Run with terraform init && terraform apply

Content:

"explorer.experimental.fileNesting.enabled": true,
"explorer.experimental.fileNesting.patterns": {
"*.ts": "${capture}.js",
"*.js": "${capture}.js.map, ${capture}.min.js, ${capture}.d.ts",
"*.jsx": "${capture}.js",
"*.tsx": "${capture}.ts",
"tsconfig.json": "tsconfig.*.json",
"package.json": "package-lock.json, yarn.lock",
"pubspec.yaml": "pubspec.lock,LICENSE,*.yaml",
"*_cubit.dart": "${capture}_state.dart, ${basename}.freezed.dart, ${basename}.g.dart",
@ArinFaraj
ArinFaraj / Render_multiple_widgets.dart
Last active January 6, 2021 16:16
Render multiple widgets to png
import 'dart:async';
import 'dart:io';
import 'dart:ui';
import 'package:file_picker_cross/file_picker_cross.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:supercharged/supercharged.dart';
class Diagram {
@ArinFaraj
ArinFaraj / BitmapEditor.cs
Created May 17, 2020 15:20
this is a way to remove a color from a bitmap image in wpf (subtract the color)
private static WriteableBitmap Subtract(Color color, BitmapSource bitmap)
{
unsafe
{
if (bitmap == null) return null;
var writeableBitmap = new WriteableBitmap(bitmap);
var width = writeableBitmap.PixelWidth;
var height = writeableBitmap.PixelHeight;
var stride = writeableBitmap.BackBufferStride;
@ArinFaraj
ArinFaraj / DrawingBoard.cs
Last active May 10, 2020 11:25
this was my dirty solution for flood filling (bucket tool) for a bitmapImage in a WPF app hope you find it useful, this can be improved ofc
protected override async void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
base.OnMouseLeftButtonDown(e);
if (DrawingMode == Tool.Fill)
{
/*
* turn the canvas into bitmap thing
* use a fill method to fill the pixels
* convert the bitmap thing back to visual