Skip to content

Instantly share code, notes, and snippets.

View skunkworker's full-sized avatar

John Bolliger skunkworker

View GitHub Profile
extension UIHostingController {
convenience public init(rootView: Content, ignoreSafeArea: Bool) {
self.init(rootView: rootView)
if ignoreSafeArea {
disableSafeArea()
}
}
func disableSafeArea() {
@mobilinked
mobilinked / gist:9b6086b3760bcf1e5432932dad0813c0
Last active February 9, 2024 13:03
SwiftUI - prevent auto dismiss the sheet by drag down
//
// Created by https://quickplan.app on 2020/11/8.
//
import SwiftUI
/// Control if allow to dismiss the sheet by the user actions
/// - Drag down on the sheet on iPhone and iPad
/// - Tap outside the sheet on iPad
/// No impact to dismiss programatically (by calling "presentationMode.wrappedValue.dismiss()")
@nadavrot
nadavrot / Matrix.md
Last active April 2, 2024 06:45
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@ipepe
ipepe / install-chrome-headless.sh
Last active April 19, 2024 07:15
Installing headless chrome on Ubuntu.
#!/bin/bash
# from https://chromium.woolyss.com/
# and https://gist.github.com/addyosmani/5336747
# and https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:canonical-chromium-builds/stage
sudo apt-get update
sudo apt-get install chromium-browser
chromium-browser --headless --no-sandbox http://example.org/
@joduplessis
joduplessis / cookie-typescript-utils.ts
Created September 12, 2017 06:50
Setting, deleting and retrieving cookies in Typescript.
@pablopaul
pablopaul / deploy.rb
Last active February 5, 2019 19:19 — forked from cannikin/deploy.rb
Notify Sentry of a new release via Capistrano with Auth Token
# This task will notify Sentry via their API[1] that you have deployed
# a new release. It uses the release timestamp as the `version`
# (like 20151113182847) and the git ref as the optional `ref` value.
#
# This task requires several environment variables be set (or just
# hardcode the values in here if you like living on the edge):
#
# ENV['SENTRY_API_ENDPOINT'] : API endpoint, https://app.getsentry.com
# ENV['SENTRY_ORG'] : the organization for this app
# ENV['SENTRY_PROJECT'] : the project for this app
@webframp
webframp / keybase.md
Created July 25, 2017 18:14
Signing git commits on github using keybase.io gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

@ziadoz
ziadoz / install.sh
Last active April 20, 2024 10:18
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@mubix
mubix / infosec_newbie.md
Last active April 7, 2024 22:35
How to start in Infosec