Skip to content

Instantly share code, notes, and snippets.

View josephschmitt's full-sized avatar

Joe Schmitt josephschmitt

View GitHub Profile
@josephschmitt
josephschmitt / stay_standalone.html
Created June 23, 2011 14:13 — forked from irae/_Stay_standalone.md
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<html>
<head>
<title>stay standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width,initial-scale=1.5,user-scalable=no">
<script type="text/javascript">
(function() {
// prevents links from apps from oppening in mobile safari
// this javascript must be the first script in your <head>
@josephschmitt
josephschmitt / gist:5996292
Last active December 19, 2015 18:08
I've been using TextMate and SublimeText for 5+ years. I recently learned iOS development and had to use Xcode on a daily basis. Here's everything I hate about using it purely as a text editor (since LLVM itself is pretty amazing).

Things I hate about Xcode as a text editor.

  • No line delete
  • cmd+left goes to the beginning of the line, not beginning of the text
  • cmd + shift + left highlights line + indentation
  • pasting a line w/ indentation pastes indentation
  • Option-right from the beginning of the line jumps to the end of the first token, not the beginning
  • Cmd + / doesn't reliably uncomment commented lines
  • No multiple carets
  • No multi-line typing, only deleting
// New-style Flexbox SCSS Mixins
//
// Documentation shamelessly stolen from
// Chris Coyier <http://css-tricks.com/snippets/css/a-guide-to-flexbox/>
// -----------------------------------------------------------------------------
// Flex Container Properties
// -----------------------------------------------------------------------------
// This defines a flex container; block. Thus, it enables a flex context for all

Atom Editor Settings

@josephschmitt
josephschmitt / plex-pip.js
Created September 2, 2017 18:13
Stops the Plex web app from blocking right-click on the video to enter Picture in Picture
(function (plex) {
let timeout;
plex.addEventListener('contextmenu', (e) => {
const button = plex.querySelector('[class*="AudioVideoFullPlayer-isVideo"]');
const miniPlayer = plex.querySelector('[class*="MiniPlayerContainer-miniPlayer"]')
const wasVideoBlocked = (button && button.contains(e.target) || (miniPlayer && miniPlayer.contains(e.target)));
toggleBlock(wasVideoBlocked, button, miniPlayer);
@josephschmitt
josephschmitt / seven-dirty-words.txt
Created August 15, 2019 02:16
Seven dirty words never to be said at Compass
redfin,zillow,trulia,real deal,IPO,lawsuit,401k
@josephschmitt
josephschmitt / .gitconfig
Last active February 8, 2021 15:51
Global .gitconfig file
[alias]
am = "!f() { git add .; git commit --amend; }; f"
bl = branch --list
bd = "!f() { git branch -D $1; }; f"
# Create a new branch based off origin/master or switch to a branch if it already exists
br = "!f() { cur_branch=$(git rev-parse --verify refs/heads/$1 2> /dev/null); if [[ -z $cur_branch ]]; then git checkout -b $1 ${2:-origin/master} --no-track; else git checkout $1; fi }; f"
# Switch to a new branch and delete the old branch
brd = "!f() { cur_branch=$(git rev-parse --abbrev-ref HEAD); git br $1 $2; git branch -d $cur_branch --force; }; f"
c = "!f() { if [[ ! -z "$1" ]]; then git commit -m \"$1\"; else git commit; fi; }; f"
ca = "!f() { git add .; git c \"$1\"; }; f"
@josephschmitt
josephschmitt / server.ts
Last active August 4, 2022 07:28
Basic Probot application setup
import {Application} from 'probot';
import {Context} from 'probot/lib/context';
export = (app: Application) => {
app.on('pull_request', async (context: Context) => {
context.logger.info('Pull Request event', context.payload);
});
app.on('check_suite.requested', async (context: Context) => {
await context.github.checks.create({
import {ChecksUpdateResponse, ChecksUpdateParamsOutput, ChecksCreateResponse, Response, ReposCompareCommitsResponse} from '@octokit/rest';
export interface ICheckRun {
start(): Promise<Response<ChecksCreateResponse> | false>;
run(compare: Response<ReposCompareCommitsResponse>): Promise<void>;
finish(success: boolean, output?: ChecksUpdateParamsOutput): Promise<Response<ChecksUpdateResponse>>;
}
import {ChecksUpdateResponse, ChecksUpdateParamsOutput, ChecksCreateResponse, Response, ReposCompareCommitsResponse} from '@octokit/rest';
import {WebhookPayloadCheckRun, WebhookPayloadCheckSuite, WebhookPayloadPullRequest} from '@octokit/webhooks';
import {GitHubAPI} from 'probot/lib/github';
import {Context} from 'probot/lib/context';
import {Logger} from 'probot/lib';
export default class CheckRun {
public context: Context;
public github: GitHubAPI;