Skip to content

Instantly share code, notes, and snippets.

@bryant988
bryant988 / zillow.js
Last active May 3, 2024 15:23
Zillow Image Downloader
/**
* NOTE: this specifically works if the house is for sale since it renders differently.
* This will download the highest resolution available per image.
*/
/**
* STEP 1: Make sure to *SCROLL* through all images so they appear on DOM.
* No need to click any images.
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@veuncent
veuncent / aws_glacier_delete_vault.md
Last active May 12, 2024 18:26
Delete all archives in an AWS Vault

AWS Glacier: Delete vault

Follow these steps to remove all archives from an AWS vault. After this is finished, you will be able to delete the vault itself through the browser console.

Step 1 / Retrieve inventory

This will create a job that collects required information about the vault.

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME 

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

// An approximation of the TaskPaper 2 Helvetidark theme for TaskPaper 3
@text-color: rgb(90%, 90%, 90%);
@background-color: rgb(10%, 10%, 10%);
@font-family: 'Helvetica Neue';
@user-font-size: @base-font-size - 2;
@selection-color: rgb(20%, 20%, 20%);
@invisibles-color: mix(@tint-color, @background-color, 70%);
@cursor-color: rgb(40%, 40%, 40%);
public func Synchronize(semaphore : AnyObject, @noescape block : Void throws -> Void) rethrows -> Void
{
objc_sync_enter(semaphore)
defer { objc_sync_exit(semaphore) }
try block()
}
@warn_unused_result
public func Synchronize<Type>(semaphore : AnyObject, @noescape block : Void throws -> Type) rethrows -> Type
@kyleve
kyleve / Init.swift
Last active February 3, 2018 23:01
// Make initialization + configuration of mutable classes (such as views) easier.
@warn_unused_result
public func Init<Type>(value : Type, @noescape block: (object: Type) throws -> Void) rethrows -> Type
{
try block(object: value)
return value
}
func example()
{

in /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/XCLanguageSupport.xcplugin/Contents/Resources/Swift.xcspec find the dictionary with identifier com.apple.xcode.tools.swift.compiler and under options add this:

{
	Name = "SWIFT_DEBUG_TIME_FUNCTION_BODIES";
	Type = Boolean;
	DefaultValue = YES;
	CommandLineArgs = {
		YES = (
			"-Xfrontend", "-debug-time-function-bodies",

);

@steipete
steipete / DevelopmentEnviromentDetector.m
Last active October 30, 2019 03:49
Detect if you're currently running a development version or an App Store/Ad Hoc version.
static BOOL PSPDFIsDevelopmentBuild(void) {
#if TARGET_IPHONE_SIMULATOR
return YES;
#else
static BOOL isDevelopment = NO;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// There is no provisioning profile in AppStore Apps.
NSData *data = [NSData dataWithContentsOfFile:[NSBundle.mainBundle pathForResource:@"embedded" ofType:@"mobileprovision"]];
if (data) {
@davedelong
davedelong / gist:7371853
Last active May 16, 2020 02:51
Delegate proxying (`protocol_methodForEach()` is a custom function that does just what its name implies)
@interface DDDelegateProxy : NSProxy
+ (id)proxyForDelegate:(id)delegate conformingToProtocol:(Protocol *)protocol;
@property (weak, readonly) id delegate;
@property (strong, readonly) Protocol *protocol;
/*!
* Set a default return value for a method on the delegate's protocol.
* \param value This must be a block that returns the default value. Bad Things will happen if it's not.