Skip to content

Instantly share code, notes, and snippets.

View theangelperalta's full-sized avatar

Angel Peralta theangelperalta

  • Peacock
  • New York, New York
  • 04:18 (UTC -04:00)
View GitHub Profile
@gdavis
gdavis / ThreadSafe.swift
Last active July 19, 2024 19:31
ThreadSafe is a property wrapper that can be used to control atomic access to the underlying property while allowing concurrent access to reading the value.
//
// ThreadSafe.swift
// GDICore
//
// Created by Grant Davis on 1/2/21.
// Updated to support `_modify` accessor on 12/5/21.
//
// Copyright © 2021 Grant Davis Interactive, LLC. All rights reserved.
//
import Foundation
@WetHat
WetHat / CL-PrettyPrintTableData.ipynb
Last active May 27, 2024 23:12
Pretty Print Table Data in Common Lisp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jaytaylor
jaytaylor / ._README.md
Last active March 4, 2024 23:39
URL Encoding in pure bash / sed.
@gnou
gnou / TextSize.swift
Created March 21, 2017 10:09
Calculate height of some text when width is fixed
public struct TextSize {
fileprivate struct CacheEntry: Hashable {
let text: String
let font: UIFont
let width: CGFloat
let insets: UIEdgeInsets
fileprivate var hashValue: Int {
return text.hashValue ^ Int(width) ^ Int(insets.top) ^ Int(insets.left) ^ Int(insets.bottom) ^ Int(insets.right)
@doole
doole / install_psql_php.sh
Last active September 21, 2023 19:12
Install PostgreSQL PHP extensions on Mac OS X
#!/bin/bash
# Install Xcode Command Line Tools first (required)
xcode-select --install
# Check PHP version `php --version`
PHP_VER=$(php -v | head -1 | awk '{ print $2 }')
# Extensions directory (default: empty string)
EXT_DIR=""