Skip to content

Instantly share code, notes, and snippets.

View vilhalmer's full-sized avatar

Bill Doyle vilhalmer

View GitHub Profile
// http://opensource.apple.com/source/CF/CF-1153.18/CFInternal.h
// Returns a generic dispatch queue for when you want to just throw some work
// into the concurrent pile to execute, and don't care about specifics except
// to match the QOS of the main thread.
CF_INLINE dispatch_queue_t __CFDispatchQueueGetGenericMatchingMain(void) {
return dispatch_get_global_queue(qos_class_main(), DISPATCH_QUEUE_OVERCOMMIT);
}
// Returns a generic dispatch queue for when you want to just throw some work
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@Earnestly
Earnestly / makepkg_overview.rst
Last active March 21, 2025 23:21
A brief overview of the process involved in creating a pacman package.

A Brief Tour of the Makepkg Process: What Makes a Pacman Package

Introduction

This is a terse document covering the anatomy of a package built for the pacman package manager.

The following example commands can mostly run verbatim to manually create a

@benley
benley / nix-profile.sh
Created January 6, 2015 07:57
tweaked nix login script
# Heavily cribbed from the equivalent NixOS login script.
# This should work better with multi-user nix setups.
export NIXPKGS_CONFIG="/etc/nix/nixpkgs-config.nix"
export NIX_OTHER_STORES="/run/nix/remote-stores/*/nix"
export NIX_USER_PROFILE_DIR="/nix/var/nix/profiles/per-user/$USER"
export NIX_PROFILES="/nix/var/nix/profiles/default $HOME/.nix-profile"
export NIX_PATH="/nix/var/nix/profiles/per-user/root/channels"
export PATH="$HOME/.nix-profile/bin:$HOME/.nix-profile/sbin:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:$PATH"
@ValdikSS
ValdikSS / debian-rules-strongswan-enable-xauth-noauth-and-kernel-libipsec.patch
Last active November 15, 2022 10:09
Debian Jessie strongSwan 5.2.1 enable kernel-libipsec and xauth-noauth
--- strongswan-5.2.1/debian/rules 2014-10-27 14:36:53.659872404 +0300
+++ strongswan-5.2.1/debian/rules 2014-10-27 15:10:07.003054721 +0300
@@ -15,7 +15,7 @@
--enable-ha \
--enable-led --enable-gcrypt \
--enable-test-vectors \
- --enable-xauth-eap --enable-xauth-pam \
+ --enable-xauth-eap --enable-xauth-pam --enable-xauth-noauth \
--enable-cmd \
--enable-certexpire \
@calebd
calebd / ArrayHelpers.swift
Last active January 29, 2025 06:05
Swift Helpers
extension Array {
func first() -> Element? {
if isEmpty {
return nil
}
return self[0]
}
func last() -> Element? {
{
"color_scheme": "Packages/Dayle Rees Color Schemes/sublime/peel.tmTheme",
"font_face": "Inconsolata",
"font_size": 16,
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 4,
"line_padding_top": 4,
@swillits
swillits / Unquarantine.sh
Last active February 12, 2024 23:32
(Gatekeeper) Unquarantine files. http://www.sethwillits.com/temp/Unquarantine.workflow.zip Automator service. Stick in ~/Library/Services. Right-click file(s) in Finder, Services -> Unquarantine. Bingo!
function unquarantine()
{
for file in $@
do
xattr -d com.apple.quarantine $file
if [ -d "${file}" ] ; then
while IFS= read -r -d '' subfile; do
if [ "$file" != "$subfile" ]; then
unquarantine $subfile;
@matthiasplappert
matthiasplappert / gist:9493050
Last active August 29, 2015 13:57
QuickLook Debugging for `UIView`
@interface UIView (MPAdditions)
@end
@implementation UIView (MPAdditions)
- (id)debugQuickLookObject {
if (self.bounds.size.width < 0.0f || self.bounds.size.height < 0.0f) {
return nil;
}
@davepeck
davepeck / oops.c
Created February 22, 2014 10:07
iOS 7.0.6 "Security Content"
static OSStatus
SSLVerifySignedServerKeyExchange(SSLContext *ctx, bool isRsa, SSLBuffer signedParams,
uint8_t *signature, UInt16 signatureLen)
{
OSStatus err;
SSLBuffer hashOut, hashCtx, clientRandom, serverRandom;
uint8_t hashes[SSL_SHA1_DIGEST_LEN + SSL_MD5_DIGEST_LEN];
SSLBuffer signedHashes;
uint8_t *dataToSign;
size_t dataToSignLen;