Skip to content

Instantly share code, notes, and snippets.

View josephschmitt's full-sized avatar

Joe Schmitt josephschmitt

View GitHub Profile
// 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
@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>

Atom Editor Settings

@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
@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
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;
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>>;
}
// By default, use a try/catch with async await
try {
await someRemoteAction();
} catch (e) {
console.error(e);
}
// If you need to store the result of an async/await AND you want the catch to be a specific value...
const myResult = await someRemoteAction().then(() => 'some-value').catch(() => 'some-error-value');
// myResult will equal 'some-value' on success, but 'some-error-value' on error
@josephschmitt
josephschmitt / script.md
Last active April 14, 2020 18:50
How to create a new `JoeDemoService` backend service in 7 easy steps...

Node GRPC Demo Script

How to create a new JoeDemoService backend service in 7 easy steps...

  1. Create new thrift file in ~/development/urbancompass/src/thrift/urbancompass/joe_demo:
namespace go joe_demo.joe_demo_service
namespace java com.urbancompass.joe_demo
namespace js joe_demo.joe_demo_service