Skip to content

Instantly share code, notes, and snippets.

View pwightman's full-sized avatar

Parker Wightman pwightman

View GitHub Profile
@conradev
conradev / NavigationStackView.swift
Last active May 16, 2023 09:55
NavigationStackView
import SwiftUI
@main
struct ExampleApp: App {
var body: some Scene {
WindowGroup {
OnboardingView()
}
}
}

Gmail Filters

Catch newsletters and junk

Matches: ("opt-out" OR unsubscribe OR "viewing the newsletter" OR "privacy policy" OR enews OR "edit your preferences" OR "email notifications" OR "update profile" OR smartunsubscribe OR secureunsubscribe OR yahoogroups OR "manage your account" OR "group-digests") Do this: Skip Inbox, Apply label "Work/Newsletters"

Keep pesky calendar invites out of inbox

Matches: (subject:("invitation" OR "accepted" OR "rejected" OR "updated" OR "canceled event" OR "declined") when where calendar who organizer) Do this: Skip Inbox, Apply label "GTD/Follow up"

Keep 90% of Sales emails out of Inbox

@parroty
parroty / .tool-versions
Created December 30, 2015 08:48
Elixir build example at CircleCI
erlang 18.0
elixir 1.1.1
@praeclarum
praeclarum / ArrayDiff.swift
Last active January 8, 2021 06:10
A generic diffing operation that can calculate the minimal steps needed to convert one array to another. It can be used to generate standard diffs, or it can be used more creatively to calculate minimal UI updates.
//
// ArrayDiff.swift
//
// Created by Frank A. Krueger on 6/30/15.
// Copyright © 2015 Krueger Systems, Inc. All rights reserved.
// License: MIT http://opensource.org/licenses/MIT
//
import Foundation
@atomkirk
atomkirk / PassInError.swift
Last active August 29, 2015 14:22
Pass In Error
// PassInError.swift
// Created by Adam Kirk on 6/6/15.
import Foundation
typealias PassInErrorBlock = (error: NSError) -> Void
class PassInError: NSObject {
dynamic var ref: NSError?
@andymatuschak
andymatuschak / MultiDirectionAdjudicatingScrollView.swift
Created January 26, 2015 19:31
Source for the Khan Academy app's unusual scrolling interactions
//
// MultiDirectionAdjudicatingScrollView.swift
// Khan Academy
//
// Created by Andy Matuschak on 12/16/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit
import UIKit.UIGestureRecognizerSubclass
@exce11ent
exce11ent / Merge two videos
Last active August 3, 2017 06:48
Merge two videos using AVFoundation ios
AVMutableComposition* mixComposition = [[AVMutableComposition alloc] init];
NSString *path1 = _exportPaths[0];
NSString *path2 = _exportPaths[1];
//load assets
AVURLAsset *asset1 = [AVURLAsset URLAssetWithURL:[NSURL fileURLWithPath:path1] options:nil];
AVURLAsset *asset2 = [AVURLAsset URLAssetWithURL:[NSURL fileURLWithPath:path2] options:nil];
//create mutable composition track and add all assets to this track
AVMutableCompositionTrack *track = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid];

How I Wish Racket Was First Explained To Me

I've been taking a compilers class this semester from Matt Might, which has been a great experience. Amongst the most challenging/interesting aspects of the course has been taming Racket, a Scheme-y/LISP-y language (I'll leave it at that).

Having never used anything functional/LISP-y in my days, this was a brand new experience. On the whole, it was good, but here's how I wish my first introduction to the language had gone as it would have set me on the right foot. While I'm focusing on Racket here, I imagine this same thing applies to LISP/Scheme and its derivatives.

Code vs. Data

I read everywhere that, "In Racket, code and data are the same thing." That sentence alone was useless to me, and it took a number of weeks before I "got it." Perhaps this explanation may have been more helpful:

@chrisjlee
chrisjlee / drupal-views-share-global-text-field
Last active April 23, 2024 04:07
share url's for facebook, twitter, pinterest with just get variables
<ul>
<li class="share-text">Share this>/li>
<li class="share-tw"><a href="http://twitter.com/share?text=[title]"><span></span></a></li>
<li class="share-fb"><a href="http://www.facebook.com/sharer.php?u=/node/[nid]&p=[title]"><span></span></a></li>
<li class="share-pinterest"><a href="http://pinterest.com/pin/create/button/?url=/node/[nid]&description=[title]"><span></span></a></li>
</ul>
@jamesejr
jamesejr / .bashrc
Last active December 14, 2015 11:19
Personal .bashrc file with Terminal colors, Homebrew tab completion, and custom Bash/Git prompts
# Add Git branch prompt
function git-current-branch {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
# Add custom bash prompt via kirsle.net/wizards/ps1.html
export PS1="\u@macbook \[$(tput setaf 2)\][\W] \[$(tput setaf 1)\]\$(git-current-branch)\[$(tput setaf 7)\]> \[$(tput sgr0)\]"
# Add Git auto completion support
source /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash