Skip to content

Instantly share code, notes, and snippets.

@fxm90
fxm90 / SwiftUI+HTML.swift
Created June 28, 2021 14:43
Extension that converts Strings with basic HTML tags to SwiftUI's Text (Supports SwiftUI 3.0 / iOS 15.0).
//
// SwiftUI+HTML.swift
//
// Created by Felix Mau on 28.05.21.
// Copyright © 2021 Felix Mau. All rights reserved.
//
import SwiftUI
@available(iOS 15.0, *)
@sai-krishna-acceleron
sai-krishna-acceleron / generate_keys.py
Created October 1, 2020 03:34
Generating keys with GPG
import os
import gnupg
pwd = os.getcwd()
gpg = gnupg.GPG(gnupghome=pwd, verbose=False)
gpg.encoding = "utf-8"
key_input = gpg.gen_key_input(key_type="RSA", key_length=2048, name_real="Si Ki", name_comment="dev",
name_email="io@acceleron")
@patmigliaccio
patmigliaccio / install-cf-gae-ssl.md
Last active March 25, 2024 18:01
Configuring Cloudflare SSL/TLS certificates on Google App Engine

Configuring Cloudflare SSL/TLS on Google App Engine

Implementing end-to-end HTTPS encryption with CloudFlare for Google App Engine applications.

Google App Engine - Custom Domains

Add Domains

Register the root domain with Google Cloud Platform at the following:

@chimmelb
chimmelb / chromiumpackages.config
Last active April 4, 2024 16:07
.ebextensions config file to load NodeJS EB instance with packages needed for Puppeteer/Chromium
# This is for ElasticBeanstalk with Amazon Linux 2023. For previous Linux 2 or Linux 1, see revisions for ideas
packages:
yum:
cups-libs: []
libdrm: []
libXdamage: []
libXfixes: []
libXrandr: []
mesa-libgbm: []
libxkbcommon: []
@robhrt7
robhrt7 / MySQL_5-7_macOS.md
Last active February 28, 2024 03:48 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@leilee
leilee / UIView+GradientBorder.swift
Last active March 29, 2024 12:05
Add gradient border to UIView
public extension UIView {
private static let kLayerNameGradientBorder = "GradientBorderLayer"
public func setGradientBorder(
width: CGFloat,
colors: [UIColor],
startPoint: CGPoint = CGPoint(x: 0.5, y: 0),
endPoint: CGPoint = CGPoint(x: 0.5, y: 1)
) {
@Gnzlt
Gnzlt / RadioButtonPreference.java
Created February 22, 2017 12:24
Android check box preference with check box replaced by radio button
public class RadioButtonPreference extends CheckBoxPreference {
public RadioButtonPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
setWidgetLayoutResource(R.layout.preference_widget_radiobutton);
}
public RadioButtonPreference(Context context, AttributeSet attrs) {
super(context, attrs);
setWidgetLayoutResource(R.layout.preference_widget_radiobutton);
@eoghain
eoghain / CustomInteractiveAnimationNavigationController.swift
Last active September 21, 2023 07:33
UINavigationController that implements swipe to push/pop in an interactive animation. Just implement the InteractiveNavigation protocol on your ViewControllers you add to the nav stack to get custom transitions. Or implement a single animation and return it instead of the nil's in the UIViewControllerTransitioningDelegate and all transitions wil…
import UIKit
protocol InteractiveNavigation {
var presentAnimation: UIViewControllerAnimatedTransitioning? { get }
var dismissAnimation: UIViewControllerAnimatedTransitioning? { get }
func showNext()
}
enum SwipeDirection: CGFloat, CustomStringConvertible {
//
// Created by Nick Vance on 12/4/15.
// Modified by Ryan Reece on 11/14/16.
//
import AVKit
import XCDYouTubeKit
import TVMLKit
class YTPlayerViewController: AVPlayerViewController, AVPlayerViewControllerDelegate {
@mmasashi
mmasashi / creaet_read_only_user.sql
Created November 14, 2016 20:24
Create read-only user on MySQL
CREATE USER r_only_user identified by 'password';
GRANT SELECT, SHOW VIEW, PROCESS, REPLICATION CLIENT ON *.* TO 'r_only_user'@'%' IDENTIFIED BY 'password';
GRANT SELECT, SHOW VIEW, PROCESS, REPLICATION CLIENT ON *.* TO 'r_only_user'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;