Skip to content

Instantly share code, notes, and snippets.

View hngouveia01's full-sized avatar

Henrique Gouveia hngouveia01

View GitHub Profile
@vorce
vorce / jerry.swift
Last active August 15, 2024 11:14
Mouse move and click test thing for macos in swift
import Cocoa
import Foundation
// Move around and click automatically at random places in macos, kinda human like in a cheap way.
// Moves the mouse pointer to `moves` random locations on the screen and runs the `action` function at
// each point with the point as argument.
func mouseMoveWithAction(moves: Int, action: (CGPoint) -> Void = defaultAction) {
let screenSize = NSScreen.main?.visibleFrame.size
//------------------------------------------------------------------------
// The SwiftUI Lab: Advanced SwiftUI Animations
// https://swiftui-lab.com/swiftui-animations-part1 (Animating Paths)
// https://swiftui-lab.com/swiftui-animations-part2 (GeometryEffect)
// https://swiftui-lab.com/swiftui-animations-part3 (AnimatableModifier)
//------------------------------------------------------------------------
import SwiftUI
struct ContentView: View {
@bananafish911
bananafish911 / VideoConverter.swift
Created March 5, 2019 14:36
Video Converter Swift 4.2
// Created by Victor on 1/16/19.
// Copyright © 2019 tchop. All rights reserved.
//
// https://medium.com/samkirkiles/swift-using-avassetwriter-to-compress-video-files-for-network-transfer-4dcc7b4288c5
import Foundation
import AVFoundation
class VideoConverter {
@boeledi
boeledi / OverlayableContainerOnLongPress_sample.dart
Last active May 1, 2024 04:47
How to display an overlay on top of a particular item, present in a Scroll Area, on longPress?
import 'package:flutter/material.dart';
import 'dart:math';
void main() {
///
/// Launch the application
///
runApp(const Application());
}
@troyfontaine
troyfontaine / 1-setup.md
Last active November 18, 2024 14:14
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@powhu
powhu / GIF2MP4.swift
Last active December 28, 2023 22:41
Swift 5.0 GIF to MP4
//
// GIF2MP4.swift
//
// Created by PowHu Yang on 2020/4/24.
// Copyright © 2020 PowHu Yang. All rights reserved.
//
/* How to use
let data = try! Data(contentsOf: Bundle.main.url(forResource: "gif", withExtension: "gif")!)
let tempUrl = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("temp.mp4")
@kharrison
kharrison / SwiftIntegerGuide.swift
Created February 17, 2017 16:43
Swift Integer Quick Guide
// -------------------------------------
// Swift Integer Quick Guide
// -------------------------------------
// Created by Keith Harrison http://useyourloaf.com
// Copyright (c) 2017 Keith Harrison. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
@hngouveia01
hngouveia01 / systemctl_serial-getty.txt
Last active October 4, 2016 17:28
SOLUTION - systemctl hangs and gives "Connection timed out" in every call when using [email protected]
I've stumbled upon this problem after migrating from sysvinit to systemd.
To get the serial console working on systemd I had to set up a service called [email protected]. It uses
agetty as a way to open ports, ask for login name and password.
The problem started after I noticed that my custom program, called with /sbin/agetty -i -n -l <program>, would not recognize the
Enter inserted as a End Of Line (EOL) special char. Then, I had to change from agetty to /bin/busybox getty to get the key recognized.
*latter I learned that this problem could be resolved using the command 'stty cooked'*
@hngouveia01
hngouveia01 / Macbook Pro Fedora
Last active October 20, 2016 15:10
Get your wifi working with your Fedora 24
Every time you update your Fedora or in a plain new installation, run these commands to get your wifi working.
Install
1- install the kernel-devel packages:
sudo dnf install akmods "kernel-devel-uname-r == $(uname -r)"
2- install broadcom-wl:
sudo dnf install broadcom-wl
@arya-oss
arya-oss / INSTALL.md
Last active November 18, 2023 13:58
Ubuntu 16.04 Developer Tools installation

Ubuntu 16.04 Developer Tools Installation

First things first !

sudo apt update
sudo apt upgrade

Standard Developer Tools

sudo apt-get install build-essential git