Skip to content

Instantly share code, notes, and snippets.

@floorish
floorish / AppDelegate.swift
Created August 6, 2019 19:46
NSOutlineView collapse children
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var window: NSWindow!
@IBOutlet weak var view: NSView!
lazy var outline: NSOutlineView = {
let v = NSOutlineView()
import XCTest
class InjectionTests: XCTestCase {
func testValidity() {
let validate: (TestProtocol) -> () = {
XCTAssertTrue($0.test(""))
XCTAssertTrue($0.test("ab"))
XCTAssertTrue($0.test("abcd"))
@floorish
floorish / index.php
Last active August 29, 2015 13:57
Automatic virtualhosts based on git branches.
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Multi</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
@floorish
floorish / Add bounds.jsx
Last active August 31, 2020 17:07
Photoshop script to show the bounds of the selected layer
// This script calculates the bounds of a selected layer (including layer styles) and creates a @bounds shape
// Author: @floorish
// Company: @touchwonders
var docRef = app.activeDocument;
docRef.suspendHistory("Add bounds", "main()");
function main() {
@floorish
floorish / fader.js
Last active January 27, 2019 18:40
Simple and lightweight javascript fader, to fade html elements
/**
* Simple and lightweight fader plugin
* Css support detection from Modernizr
* http://modernizr.com/
*
* usage: fader.fadeOut('loader').fadeIn('content', 700, 400);
* note that the element must be a id string for now
*
* @author floorish
*/