Skip to content

Instantly share code, notes, and snippets.

View liscio's full-sized avatar

Christopher Liscio liscio

View GitHub Profile
@liscio
liscio / main.mm
Created October 17, 2023 17:08
It doesn't take much to corrupt the FPU state on Intel machines running macOS Sonoma!
#import <Cocoa/Cocoa.h>
#import <iostream>
static long double _giantValue = 0.0;
void writeGiantValue(long double inValue) {
_giantValue = inValue;
}
long double readGiantValue() {
@liscio
liscio / SwiftUILunch.swift
Created June 26, 2020 17:03 — forked from ishabazz/SwiftUILunch
Trying to figure out how to show derived Views from different data types.
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
import SwiftUI
enum ComponentType{
case sandwich
case smoothie
case soup
@liscio
liscio / retinaify.sh
Created March 12, 2015 18:33
Make Preview open your @2x .png files as if they are retina images
#!/bin/sh
# First, set the width/height DPI on the file
sips -s dpiWidth 144 -s dpiHeight 144 "$1"
# Fake that it is a screen capture (wat?)
xattr -wx com.apple.metadata:kMDItemIsScreenCapture "62 70 6C 69 73 74 30 30 09 08 00 00 00 00 00 00 01 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09" "$1"
xattr -wx com.apple.metadata:kMDItemScreenCaptureType "62 70 6C 69 73 74 30 30 59 73 65 6C 65 63 74 69 6F 6E 08 00 00 00 00 00 00 01 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12" "$1"
xattr -wx com.apple.FinderInfo "00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" "$1"
class Person:
p = Person()
p.name = "Foo"
In Ruby:
class Person
attr_accessor :name
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Major Version</key><integer>1</integer>
<key>Minor Version</key><integer>1</integer>
<key>Application Version</key><string>10.5b48</string>
<key>Features</key><integer>5</integer>
<key>Show Content Ratings</key><true/>
<key>Music Folder</key><string>file://localhost/Users/chris/Music/iTunes/iTunes%20Media/</string>
@liscio
liscio / pasteboard_types.txt
Created July 29, 2011 17:13
iTunes Pasteboard Types
(gdb) po [[sender draggingPasteboard] types]
<__NSArrayM 0x102912710>(
com.apple.pasteboard.promised-file-url,
dyn.ah62d4rv4gu8y6y4usm1044pxqzb085xyqz1hk64uqm10c6xenv61a3k,
NSPromiseContentsPboardType,
com.apple.itunes.iappurl,
CorePasteboardFlavorType 0x4855666C,
JRFS,
Dsid,
Oidl,
${PROJECT_DIR}/bin/copyFrameworks.sh "SMUGFoundation.framework SMUGOpenCL.framework SMUGAudio.framework"
find "${BUILT_PRODUCTS_DIR}"/"${FRAMEWORKS_FOLDER_PATH}" -name '*.h' -exec rm {} \;
#!/bin/sh
# copyFrameworks.sh
# Capo
#
# Created by Christopher Liscio on 11-07-05.
# Copyright 2011 SuperMegaUltraGroovy. All rights reserved.
FRAMEWORKS=${1}
PRIVATE_FRAMEWORKS_PATH=${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}
//
// videoTestMemoryViewController.h
// videoTestMemory
//
// Created by david on 06/10/10.
// Copyright 2010 E-ducation.it. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>
//
// CapoPlaybackButton.h
// Capo
//
// Created by Christopher Liscio on 9/22/10.
// Copyright (c) 2010 SuperMegaUltraGroovy. All rights reserved.
//
#import <UIKit/UIKit.h>