Skip to content

Instantly share code, notes, and snippets.

@bennadel
bennadel / preload-images.htm
Created March 27, 2014 11:55
Preloading Images In AngularJS With Promises
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Preloading Images In AngularJS With Promises
</title>
</head>
<body ng-controller="AppController">
/*! @file OIDExternalUserAgentIOSSafariViewController.h
@brief AppAuth iOS SDK
@copyright
Copyright 2018 Google Inc. All Rights Reserved.
@copydetails
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@ugenlik
ugenlik / OIDExternalUserAgentIOSSafariViewController.swift
Last active June 23, 2024 09:12
OIDExternalUserAgentIOSSafariViewController in swift
//
// OIDExternalUserAgentIOSSafariViewController.swift
// Hugin
//
// Created by Umut Genlik on 12/7/18.
// Taken from https://gist.github.com/WilliamDenniss/18f3779b4a310361bb955cf4e534f29c
import UIKit
import SafariServices
import UIKit
import SafariServices
import AuthenticationServices
import AppAuth
import Reachability
class OIDExternalUserAgentASWebAuthenticationSession: NSObject, OIDExternalUserAgent {
private let presentingViewController: UIViewController
private var externalUserAgentFlowInProgress: Bool = false
private var authenticationViewController: ASWebAuthenticationSession?
@sethdavis512
sethdavis512 / custom-file-generator-cli-tutorial.md
Last active October 25, 2023 10:51
Custom File Generator CLI Tutorial

As a developer who works on multiple React projects daily, I like having a tool that can help me quickly and efficiently write consistent code. One of the best ways I've found is writing a custom command line tool to rapidly scaffold out my most common code patterns.

My tool of choice is Plop.js. Plop is a powerful "micro-generator framework" built to help maintain patterns as well as speed up your project build time. From the documenation:

If you boil plop down to its core, it is basically glue code between inquirer prompts and handlebar templates.

In this tutorial, we'll build out a simple React component generator for your Typescript projects. By the end, you'll have a fully functioning CLI that is customized to your file generating needs. Let's get started.

Prerequisites