Skip to content

Instantly share code, notes, and snippets.

View deezaster's full-sized avatar

Andy Theiler deezaster

View GitHub Profile
@sjvnnings
sjvnnings / shakeable_camera.gd
Created December 24, 2021 19:41
An easy to use screenshake system in Godot. Built with areas and simple to modify.
#For usage instructions, see the YouTube video below:
extends Area
export var trauma_reduction_rate := 1.0
export var max_x := 10.0
export var max_y := 10.0
export var max_z := 5.0
export var noise : OpenSimplexNoise
@sjvnnings
sjvnnings / better_jumping_character_example.gd
Last active July 23, 2024 07:06
An easy to work with jump in Godot
extends KinematicBody2D
export var move_speed = 200.0
var velocity := Vector2.ZERO
export var jump_height : float
export var jump_time_to_peak : float
export var jump_time_to_descent : float
@shankar-bavan
shankar-bavan / bitbucket-pipeline-pull-files.md
Last active June 9, 2023 16:35
CI CD with bitbucket pipleline and shell script
@rodydavis
rodydavis / VCF_Card_Flutter.dart
Created January 11, 2019 13:19
Share a VCF Card in Flutter using the Native Share Sheet
import 'dart:io';
import 'package:contacts_service/contacts_service.dart';
import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
import 'package:share_extend/share_extend.dart';
/// Share a VCF Card from a Contact Object
void shareVCFCard(BuildContext context, {Contact contact}) async {
final Contact _info = contact;
@prestia
prestia / installing_MTGA_on_macOS_with_Retina_support.md
Last active October 13, 2023 23:22
Instructions on how to install Magic the Gathering Arena on macOS with Retina support.

Installing MTGA on macOS using Wine, and making it look pretty!

The following instructions are heavily inspired by /u/uhohohdear. I modified uhohohdear's instructions and then added support for Retina/HiDPI displays and instructions about how to update MTGA.

IMPORTANT UPDATE: This will no longer work if you upgrade to macOS Catalina, as Wine and Wineskin are 32-bit. I'll update this Gist with 64-bit versions when they become available.

We're back in business!

It appears that the workarounds no longer work. A few people with Macs using Nvidia graphics cards are having success, but Macs with Intel and AMD GPUs crash regularly. At this time, the best way to play Arena on Mac is via Boot Camp or GeForce Now.

@NHuyHoang
NHuyHoang / Handle BottomNavigationBar
Last active November 9, 2022 12:01
Programmatically select BottomNavigationBar Tab in Flutter instead of built in onTap callback
class _BTMAppBarState extends State<BTMAppBar> {
int navigationIndex = 0;
GlobalKey globalKey = new GlobalKey(debugLabel: 'btm_app_bar');
@override
Widget build(BuildContext context) {
return new Scaffold(
bottomNavigationBar: new BottomNavigationBar(
key: globalKey,
items: [
@slightfoot
slightfoot / download.dart
Created April 13, 2018 22:14
Download file in Dart/Flutter
static var httpClient = new HttpClient();
Future<File> _downloadFile(String url, String filename) async {
var request = await httpClient.getUrl(Uri.parse(url));
var response = await request.close();
var bytes = await consolidateHttpClientResponseBytes(response);
String dir = (await getApplicationDocumentsDirectory()).path;
File file = new File('$dir/$filename');
await file.writeAsBytes(bytes);
return file;
}
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active July 26, 2024 18:59
Vanilla JavaScript Quick Reference / Cheatsheet
@alxsimo
alxsimo / convert_img_byte_array.java
Created March 15, 2016 11:40
[Android] Convert image to bytes[] array with Glide
public static byte[] generateByteArrayProfileImage(Context context, Uri uri)
throws ExecutionException, InterruptedException {
int width = Constantes.PROFILE_IMAGE_SIZE_WIDTH;
int height = Constantes.PROFILE_IMAGE_SIZE_HEIGHT;
return Glide.with(context.getApplicationContext())
.load(uri)
.asBitmap()
.toBytes(Bitmap.CompressFormat.JPEG, 70)
@mozillazg
mozillazg / supervisord.service
Last active December 1, 2023 12:59 — forked from tonyseek/supervisord.service
install and configure supervisord on centos 7.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown