Skip to content

Instantly share code, notes, and snippets.

View dinobei's full-sized avatar

Park Byeongju dinobei

View GitHub Profile
# Building FAT librares for XCode 10
set -e
# If we're already inside this script then die
if [ -n "$MULTIPLATFORM_BUILD_IN_PROGRESS" ]; then
exit 0
fi
export MULTIPLATFORM_BUILD_IN_PROGRESS=1
@lethee
lethee / pkg-config-guide.md
Last active December 27, 2022 00:52
Guide to pkg-config 한글 번역
@DejanEnspyra
DejanEnspyra / infowindow.swift
Last active September 7, 2020 22:26
Set up custom Info Window in Google Maps iOS SDK
extension ViewController: GMSMapViewDelegate{
/* handles Info Window tap */
func mapView(_ mapView: GMSMapView, didTapInfoWindowOf marker: GMSMarker) {
print("didTapInfoWindowOf")
}
/* handles Info Window long press */
func mapView(_ mapView: GMSMapView, didLongPressInfoWindowOf marker: GMSMarker) {
print("didLongPressInfoWindowOf")
}
@tmspzz
tmspzz / NRFileManager.swift
Last active December 12, 2023 06:46
A method to calculate the accumulated size of a directory on the volume in bytes.
public extension FileManager {
/// This method calculates the accumulated size of a directory on the volume in bytes.
///
/// As there's no simple way to get this information from the file system it has to crawl the entire hierarchy,
/// accumulating the overall sum on the way. The resulting value is roughly equivalent with the amount of bytes
/// that would become available on the volume if the directory would be deleted.
///
/// - note: There are a couple of oddities that are not taken into account (like symbolic links, meta data of
/// directories, hard links, ...).
@ericdke
ericdke / getMacUUID.swift
Last active October 31, 2023 05:04
Swift: get the Mac UUID
func getSystemUUID() -> String? {
let dev = IOServiceMatching("IOPlatformExpertDevice")
let platformExpert: io_service_t = IOServiceGetMatchingService(kIOMasterPortDefault, dev)
let serialNumberAsCFString = IORegistryEntryCreateCFProperty(platformExpert, kIOPlatformUUIDKey, kCFAllocatorDefault, 0)
IOObjectRelease(platformExpert)
let ser: CFTypeRef = serialNumberAsCFString.takeUnretainedValue()
if let result = ser as? String {
return result
}
return nil
@quietcricket
quietcricket / gist:2521037
Created April 28, 2012 18:20
Get IP Address, C/C++
string getIPAddress(){
string ipAddress="Unable to get IP Address";
struct ifaddrs *interfaces = NULL;
struct ifaddrs *temp_addr = NULL;
int success = 0;
// retrieve the current interfaces - returns 0 on success
success = getifaddrs(&interfaces);
if (success == 0) {
// Loop through linked list of interfaces
temp_addr = interfaces;
@andormade
andormade / main.c
Created November 12, 2011 18:00
Audio Queue example
#include <stdlib.h>
#include <math.h>
#include <AudioToolbox/AudioQueue.h>
#include <CoreAudio/CoreAudioTypes.h>
#include <CoreFoundation/CFRunLoop.h>
#define NUM_CHANNELS 2
#define NUM_BUFFERS 3