Skip to content

Instantly share code, notes, and snippets.

View sgalvagno's full-sized avatar

Galvagno Sébastien sgalvagno

View GitHub Profile
@sgalvagno
sgalvagno / couchbase-metadata-flags.md
Created January 30, 2024 20:48 — forked from capslocky/couchbase-metadata-flags.md
Couchbase metadata Common Flags
flags value (decimal) flags value (binary) bits #[5,6,7,8] decimal type note
16777216 00000001000000000000000000000000 0001 1 Private couchbase docs example
33554432 00000010000000000000000000000000 0010 2 JSON couchbase docs example
33554438 00000010000000000000000000000110 0010 2 JSON default from http rest api
50331648 00000011000000000000000000000000 0011 3 Raw Binary couchbase docs example
@sgalvagno
sgalvagno / macOS-mojave-iso.sh
Created June 23, 2019 10:52 — forked from jamieparfet/macOS-mojave-iso.sh
Create an ISO from the mojave installer app
#!/bin/bash
# This assumes that the ~6GB mojave installer is in the /Applications folder.
# If it's not, just open the App Store, search Mojave, and you can download the installer file from there.
hdiutil create -o /tmp/mojave.cdr -size 6g -layout SPUD -fs HFS+J
hdiutil attach /tmp/mojave.cdr.dmg -noverify -mountpoint /Volumes/install_mojave
sudo /Applications/Install\ macOS\ mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_mojave
mv /tmp/mojave.cdr.dmg ~/Desktop/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ mojave
@sgalvagno
sgalvagno / LinkedTextView.h
Last active October 31, 2018 20:46 — forked from benjaminbojko/LinkedTextView.h
UITextView Subclass to avoid Long-Press Delays with embedded Links
//
// LinkedTextView.h
//
// Created by Benjamin Bojko on 10/22/14.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Benjamin Bojko
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@sgalvagno
sgalvagno / .swift
Created August 2, 2018 12:53 — forked from rd13/.swift
Copy database file from bundle to documents in Swift 3
func copyDatabaseIfNeeded() {
// Move database file from bundle to documents folder
let fileManager = FileManager.default
let documentsUrl = fileManager.urls(for: .documentDirectory,
in: .userDomainMask)
guard documentsUrl.count != 0 else {
return // Could not find documents URL
import UIKit
import XCPlayground
enum UIImageAlignment {
case Center, Left, Top, Right, Bottom, TopLeft, BottomRight, BottomLeft, TopRight
}
enum UIImageScaleMode {
case Fill,
AspectFill,