Skip to content

Instantly share code, notes, and snippets.

@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active April 17, 2025 05:05
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@ottodevs
ottodevs / pf.conf
Created May 11, 2017 22:32 — forked from trustin/pf.conf
Trustin's /etc/pf.conf for Mac OS X
# 1. Put this file to /etc/pf.conf
# 2. Install init boot scripts using IceFloor then - http://www.hanynet.com/icefloor/
# I tried to use IceFloor to configure everything but it didn't work very well.
# 3. Once done, you can confirm the rules were loaded with 'sudo pfctl -sr'
# 4. At System Preferences -> Security -> Firewall -> Firewall Options,
# check 'Block all incoming connections' to prevent annoying per-app dialogs.
set skip on lo0
set block-policy drop
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active April 12, 2025 06:26
Hyperlinks in Terminal Emulators
@cschiewek
cschiewek / x11_docker_mac.md
Last active March 25, 2025 13:23
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:
//: HashMap data structure
public struct HashMap<Key: Hashable, Value> {
typealias Element = (key: Key, value: Value)
var arraySize: Int
var numberInserted = 0
var array: [Element?]
var loadFactor: Double {
return Double(numberInserted) / Double(arraySize)
}
class Logging(object):
__name__ = 'logger.info(1)'
plist = '/System/Library/Preferences/Logging/Subsystems/'
def __init__(__name__, plist, *args, **kwargs):
super(getLogger/, self).__init__()
logger.info('Input parameters:\n'
'accessibility: "{com.apple.Accessibility.plist}"\n'
@magnetikonline
magnetikonline / README.md
Last active January 12, 2025 22:31
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script which will:

  • Iterate all commits made within a Git repository.
@Bogidon
Bogidon / GrowingTextView.swift
Last active February 15, 2021 20:06
A UITextView subclass that grows with its text but allows scrolling according to AutoLayout constraints. Updates intrinsicContentSize. For an animatable version see https://gist.github.com/Bogidon/632e265b784ef978d5d8c0b86858c2ee
//
// GrowingTextView.swift
// https://gist.github.com/Bogidon/cc0c9ae6f041413c39fb0ff146ad1b18
//
// Created by Bogdan Vitoc on 02/22/2017.
// Distributed under the MIT License: https://gist.github.com/Bogidon/cc0c9ae6f041413c39fb0ff146ad1b18#file-license
//
import UIKit
@pkuecuekyan
pkuecuekyan / WKWebViewSizeToFit.swift
Last active June 17, 2024 17:44
Adjust height of WKWebView frame based on scrollHeight of the webView's content
// Since the WKWebView has no sizeToFit() method, increase the frame height of the webView to
// match the height of the content's scrollHeight
//
// The WKWebView's `navigationDelegate` property needs to be set for the delegate method to be called
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
if webView.isLoading == false {
webView.evaluateJavaScript("document.body.scrollHeight", completionHandler: { [weak self] (result, error) in
if let height = result as? CGFloat {
{https://m.facebook.com}/pages/launchpoint/admin_invites/
{https://m.facebook.com}/pages/launchpoint/liked_pages/
{https://m.facebook.com}/pages/launchpoint/owned_pages/
{https://m.facebook.com}/pages/launchpoint/pending_invites/
fb-service://limit_friend_requests
fb://about
fb://account/recovery
fb://account_settings