Skip to content

Instantly share code, notes, and snippets.

@gruber
gruber / make_bookmarklet.pl
Last active May 5, 2024 21:11
JavaScript Bookmarklet Builder
#!/usr/bin/env perl
#
# http://daringfireball.net/2007/03/javascript_bookmarklet_builder
use strict;
use warnings;
use URI::Escape qw(uri_escape_utf8);
use open IO => ":utf8", # UTF8 by default
":std"; # Apply to STDIN/STDOUT/STDERR
@iamleeg
iamleeg / sillyloop.m
Last active December 23, 2015 23:59
You probably don't need to tell me that this is a bad idea.
#import <Foundation/Foundation.h>
typedef NS_ENUM(int, GJLRangeDirection) {
GJLRangeDirectionPositive,
GJLRangeDirectionNegative,
};
@interface GJLRange : NSEnumerator
+ (instancetype)rangeWithStart: (NSNumber *)start end: (NSNumber *)end step: (NSNumber *)step;
@0xced
0xced / NSRunningApplication+DockIcon.h
Created March 15, 2012 16:00
NSRunningApplication category to dynamically show and hide any running application icon in the Dock
//
// Created by Cédric Luthi on 2011-05-03
// Copyright 2011-2012 Cédric Luthi. All rights reserved.
//
#import <AppKit/AppKit.h>
@interface NSRunningApplication (DockIcon)
- (BOOL) setDockIconHidden_xcd:(BOOL)dockIconHidden;