Skip to content

Instantly share code, notes, and snippets.

View bdpdx's full-sized avatar

Brian Doyle bdpdx

  • CodeSage, LLC
  • Lake Oswego, Oregon
View GitHub Profile
@bdpdx
bdpdx / gist:d7efccec55ddc84c36dadf3d9cd472ed
Created January 8, 2021 03:12 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@bdpdx
bdpdx / CGVectorArithmetics.swift
Created October 10, 2020 22:07 — forked from fewlinesofcode/CGVectorArithmetics.swift
2d Vector Arithmetics Swift 5
//
//
// CGVectorArithmetics.swift
//
// Created by fewlinesofcode.com on 2/6/19.
// Copyright © 2019 fewlinesofcode.com All rights reserved.
//
import Foundation
import CoreGraphics
@bdpdx
bdpdx / Vector2D.swift
Created October 10, 2020 21:35 — forked from fewlinesofcode/Vector2D.swift
Some useful operations on 2d vectors
//
// Vector2D.swift
//
// Created by fewlinesofcode.com on 2/6/19.
// Copyright © 2019 fewlinesofcode.com All rights reserved.
//
import Foundation
struct Vector2D {
@bdpdx
bdpdx / gist:f15c65923386aff092f11647f6c31511
Created January 6, 2019 00:04 — forked from morgant/gist:1753095
Building GnuTLS on Mac OS X

Preparing the Build Environment

cd ~/Desktop
mkdir wget-build
cd wget-build

Building & Installing GMP 5.0.2

@bdpdx
bdpdx / offscreen.m
Last active April 18, 2019 07:13 — forked from chrisjdavis/offscreen.m
Creating windows offscreen for fun and profit.
- (IBAction)getImageFromWeb:(id)sender {
// grab the width and height of the document in our mobileView.
CGSize contentSize = CGSizeMake(
[[mobileView stringByEvaluatingJavaScriptFromString:@"document.body.scrollWidth;"] floatValue],
[[mobileView stringByEvaluatingJavaScriptFromString:@"document.body.scrollHeight;"] floatValue]
);
// create a new window, offscreen.
NSWindow *hiddenWindow = [[NSWindow alloc] initWithContentRect: NSMakeRect( -1000,-1000, contentSize.width, contentSize.height )
styleMask: NSTitledWindowMask | NSClosableWindowMask backing:NSBackingStoreNonretained defer:NO];