Skip to content

Instantly share code, notes, and snippets.

View shawnbierman's full-sized avatar
🎯
type type type

Shawn Bierman shawnbierman

🎯
type type type
View GitHub Profile
@shawnbierman
shawnbierman / ubuntu_install.sh
Created September 17, 2023 00:04 — forked from nginx-gists/ubuntu_install.sh
Automating Installation of WordPress with NGINX Unit on Ubuntu
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ];then
>&2 echo "This script requires root level access to run"
exit 1
fi
if [ -z "${WORDPRESS_DB_PASSWORD}" ]; then
>&2 echo "WORDPRESS_DB_PASSWORD must be set"
>&2 echo "Here is a random one that you can paste:"
@shawnbierman
shawnbierman / docker-help.md
Created October 30, 2022 20:21 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@shawnbierman
shawnbierman / laravel_valet_setup.md
Created July 7, 2022 18:13 — forked from bradtraversy/laravel_valet_setup.md
Laravel Valet install on mac

Laravel Valet Setup (Mac)

This will get you setup with Laravel & Valet on your Mac. Quentin Watt has a good video tutorial on getting setup here as well

Install Homebrew

Go to https://brew.sh/ and copy the command and run in your terminal

It will be something like this...

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@shawnbierman
shawnbierman / LoginViewController.swift
Last active April 14, 2020 18:34
How to remove the LoginViewController.swift and replace with a UITabBarController
class LoginViewController: UIViewController {
// lots of code removed.
@objc func buttonAction() {
let windowScene = view.window?.windowScene
let sceneDelegate = windowScene?.delegate as! SceneDelegate
sceneDelegate.loadTabBarController().
import UIKit
import WebKit
class DetailViewController: UIViewController, WKNavigationDelegate {
var articleURLString: String!
let webView = WKWebView()
override func loadView() {
self.view = webView
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if let cell = collectionView.cellForItem(at: indexPath) as? ClinicianViewCell {
let clinician = clinicians[indexPath.item]
UIView.animate(withDuration: 0.1, delay: 0, options: [], animations: { [weak self] in
cell.transform = CGAffineTransform(scaleX: 0.95, y: 0.95)
cell.clinicianState.transform = CGAffineTransform(scaleX: 1, y: -1)
cell.photoImageView.transform = CGAffineTransform(translationX: -3, y: 3)
class NewViewController: UIViewController {
@IBOutlet var webView: WKWebView!
var fileToLoad: URL?
override func loadView() {
webView = WKWebView()
self.view = webView
}
//
// OnboardingController.swift
// Onboarding
import UIKit
class OnboardingController: UICollectionViewController, UICollectionViewDelegateFlowLayout {
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
@shawnbierman
shawnbierman / pubsub.js
Created December 22, 2010 14:31
have only one object unsubscribe.
// get xml file & publish
km.core = {
url: 'someDir/someFile',
fetch: $.get(url, function(xml) {
$.publish('xmlFetch', [xml]);
})
};
// subscribe to xml file and do stuff
km.widget.edVolGraph = {