Skip to content

Instantly share code, notes, and snippets.

@dduan
dduan / runCommand.swift
Last active May 5, 2024 12:55
How to fork()+execv() in Swift
import Foundation
func withCStrings(_ strings: [String], scoped: ([UnsafeMutablePointer<CChar>?]) throws -> Void) rethrows {
let cStrings = strings.map { strdup($0) }
try scoped(cStrings + [nil])
cStrings.forEach { free($0) }
}
enum RunCommandError: Error {
case WaitPIDError
@mehdico
mehdico / FilterHelper.java
Created October 7, 2019 08:02
setFilter deprecated solution, it work's on all api versions.
import android.graphics.BlendMode;
import android.graphics.BlendModeColorFilter;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Build;
public class FilterHelper {
public enum Mode {
CLEAR,
@jjvillavicencio
jjvillavicencio / setup.sh
Last active May 5, 2024 12:53
Install Android SDK on Windows Bash (WSL)
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin

Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

Install Java 8

sudo apt update

sudo apt install openjdk-8-jdk-headless
@crisidev
crisidev / access.lua
Created May 14, 2018 14:47 — forked from mariocesar/access.lua
Nginx Lua script redis based for Basic user authentication
function password_encode(password)
local bcrypt = require 'bcrypt'
return bcrypt.digest(password, 12)
end
function check_password(password, encoded_password)
local bcrypt = require 'bcrypt'
return bcrypt.verify(password, encoded_password)
end
@llamacademy
llamacademy / BuildDisplayer.cs
Last active May 5, 2024 12:51
Build Incrementor Scripts from https://www.youtube.com/watch?v=PbFE0m9UMtE. If you get value from LlamAcademy, consider becoming a Patreon supporter at https://www.patreon.com/llamacademy
using TMPro;
using UnityEngine;
[RequireComponent(typeof(TextMeshProUGUI))]
public class BuildDisplayer : MonoBehaviour
{
private TextMeshProUGUI Text;
private void Awake()
{
@madkoding
madkoding / pair-dual-boot-bluetooth.md
Last active May 5, 2024 12:49
Pairing bluetooth devices in dual boot with Linux Ubuntu and Windows 10/11

Pairing Bluetooth Devices in Dual Boot with Linux Ubuntu and Windows 10/11

Introduction

This guide provides updated instructions for pairing Bluetooth devices (such as keyboards or mice) in a dual-boot environment with Linux Ubuntu and Windows 10/11, incorporating community feedback and suggestions.

Instructions

1. Pair in Linux First

  • Pair your Bluetooth device in Linux. This is crucial to ensure the LinkKey remains consistent.
  • Note: Do not re-pair the device in Linux after completing the pairing in Windows.
@natyusha
natyusha / Naty's FFXIV Endwalker Add-ons, Plugins and Mods.md
Last active May 5, 2024 12:49
All the third party add-ons, plugins and mods I use for FFXIV.

Last Updated: Patch 6.58

The program which most people use for parsing in FFXIV and several other MMOs. For an open source alternative consider using IINACT though configuring it won't be covered here.

Options

  • Main Table Encounters
    • General
      • Uncheck: Number of seconds to wait after the last combat action to begin a new encounter.
      • Uncheck: Number of seconds to wait after the last combat action to pause the encounter duration.

Plugins

@leocomelli
leocomelli / git.md
Last active May 5, 2024 12:46
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@steven2358
steven2358 / ffmpeg.md
Last active May 5, 2024 12:45
FFmpeg cheat sheet