Skip to content

Instantly share code, notes, and snippets.

View ShikiSuen's full-sized avatar
🍍

ShikiSuen ShikiSuen

🍍
View GitHub Profile
@Yousha
Yousha / .gitignore
Last active March 27, 2024 22:58
.gitignore for C/C++ developers.
##### Windows
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
@HiImJulien
HiImJulien / Swift Meets CCxx.md
Last active March 30, 2024 19:00
This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.

Swift Meets C/C++

This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.


Analytics

In this example we're going to invoke a function called say_hello, which, as the name already suggests, prints "Hello, World!" to the terminal.

@andscoop
andscoop / .keys
Created February 17, 2018 14:10
fix nice-editor (ne) backspace issue
KEY 0x7f BS
KEY 0x115 DC
@KyLeggiero
KyLeggiero / NSWindow+Fade.swift
Last active September 23, 2022 16:00 — forked from indragiek/NSWindow+Fade.h
NSWindow+Fade - Animator proxy based NSWindow fading
//
// NSWindow+Fade.swift
// BH Bezel Notification
//
// Created by Ben Leggiero on 2017-11-09.
// Translated to Swift 4 from the original (ObjC): https://gist.github.com/indragiek/1397050
// Copyright © 2017 Ben Leggiero. All rights reserved.
//
import Foundation
@Piasy
Piasy / install_ffmpeg.sh
Last active April 14, 2024 05:40
brew install ffmpeg with all options
brew options ffmpeg
brew install ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-game-music-emu \
--with-libass \
@Jamesits
Jamesits / ubuntu_enable_bbr.sh
Last active December 13, 2022 22:27
Ubuntu enable BBR
#!/bin/bash
set -eu
SYSCTL_FILE=/etc/sysctl.d/90-tcp-bbr.conf
# check root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
@ismyrnow
ismyrnow / mac-clear-icon-cache.sh
Created May 5, 2017 19:28
Clear the icon cache on a Mac when you start seeing generic icons in Finder or the Dock
sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder
@gamako
gamako / String+hex.swift
Last active March 21, 2024 02:51
Convert Hexadecimal String to Array<Uint> or Data with Swift3 style.
import Foundation
// "".hexData.hexString //
// "01".hexData.hexString // 01
// "ab".hexData.hexString // ab
// "abff 99".hexData.hexString // abff99
// "abff\n99".hexData.hexString // abff99
// "abzff 99".hexData.hexString // ab
// "abf ff 99".hexData.hexString // ab
// "abf".hexData.hexString // ab
@kristopherjohnson
kristopherjohnson / FileHandleIterators.swift
Last active May 23, 2022 00:32
Iterators for reading bytes or lines from FileHandle objects as sequences
import Foundation
extension FileHandle {
/// Return an iterator over the bytes in the file.
///
/// - returns: An iterator for UInt8 elements.
public func bytes() -> FileHandleByteIterator {
return FileHandleByteIterator(fileHandle: self)
}
// USB Vendor ID: 0x05AC
// USB Product ID: 0x0251
/* The upper label indicates the key's function.
* The lower label indicates the USB/HID Keyboard report value.
* The keyboard report (endpoint 0x81) has the following data structure:
* ```
* struct kdb_report {
* uint8_t modifier;
* uint8_t reserved;