Skip to content

Instantly share code, notes, and snippets.

View yuhao-git-star's full-sized avatar
🌏

yuhao yuhao-git-star

🌏
  • San Francisco
View GitHub Profile
@yesleon
yesleon / UIWindow+AuthenticationSession.swift
Last active July 13, 2020 03:51
A wrapper around ASWebAuthenticationSession and SFAuthenticationSession.
//
// Usage:
//
// Facebook:
//
// 1. Follow this guide (WITHOUT setting up a URL scheme in Xcode):
// https://github.com/fullstackreact/react-native-oauth/issues/76#issuecomment-335902057
//
// 2. call startFacebookAuthenticationSession(appID:completionHandler:) on a window:
//
@MrFant
MrFant / my.cnf
Created August 6, 2018 01:30
mysql configuration file template in Mac OS
#
# yii fant configuration file template for MySQL, Galera Cluster, MariaDB and Percona Server
# Location: /etc/my.cnf or /etc/mysql/my.cnf
# This template is intended to work with MySQL 5.6 and newer and MariaDB 10.0 and newer
# Get most recent updated from here:
# 本配置文件将所有character set都设置为utf8
#
[client]
@rodydavis
rodydavis / Fastfile
Last active August 18, 2022 14:44
Top-level Fastfile for Flutter
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
@proteye
proteye / rsa_pem.dart
Last active July 25, 2024 10:24
How to encode/decode RSA private/public keys to PEM format in Dart with asn1lib and pointycastle
import 'dart:convert';
import 'dart:math';
import 'dart:typed_data';
import "package:pointycastle/export.dart";
import "package:asn1lib/asn1lib.dart";
List<int> decodePEM(String pem) {
var startsWith = [
"-----BEGIN PUBLIC KEY-----",
"-----BEGIN PRIVATE KEY-----",
@ernsheong
ernsheong / access-mac-localhost-from-parallels-desktop-ie-edge.md
Last active June 14, 2024 08:39
Accessing macOS localhost from Parallels Desktop IE or Edge

Access macOS localhost from IE or Edge within Parallels Desktop

This issue is so infuriating that I'm going to take some time to write about it.

  1. MOST IMPORTANT. Your local development server must be bound to IP address 0.0.0.0. Some do this by default, but many don't. You need to make sure that you run your local server with correct IP bindings. You may need to provide additional flags to your serve commands e.g. polymer serve --hostname domain.local, hugo serve --bind 0.0.0.0. If you use a named domain like domain.local, it has to be defined in /etc/hosts and pointing at 0.0.0.0.

  2. My Parallels setting is using Shared Network, nothing special there.

  3. Open macOS Terminal and type ifconfig. Look for the value under vnic0 > inet. It is typically 10.211.55.2.

Name: Flash
Serial: eNrzzU/OLi0odswsqnHLSSzOqDGoca7JKCkpsNLXLy8v1ytJTczVLUotKNFLzs8FAJHYETc=
if anyone wants to thank ETH: 0x527c2aB55b744D6167dc981576318af96ed26676
Thank you!
@learner-long-life
learner-long-life / Rinkeby.md
Last active August 30, 2022 22:32
How to get on Rinkeby Testnet in less than 10 minutes

How to get on Rinkeby Testnet in less than 10 minutes

Following instructions from the excellent https://www.rinkeby.io/

Synchronizing a Full Node

A full node lets you access all state. There is a light node (state-on-demand) and wallet-only (no state) instructions as well,

@weihanglo
weihanglo / carthage-intro.md
Last active July 22, 2024 08:09
Carthage 簡介

Carthage

[Carthage][carthage] 是一個較新的 Cocoa 開發第三方套件管理工具,相較於知名 [CocoaPods][cocoapods] 管理工具的複雜配置,輕巧的 Carthage 在推出之後廣受 Swift 社群喜愛。

本文基於 Carthage 0.20: Unary, Binary, Ternary

特色

  • 時代潮流:Written in Swift! (v.s. CocoaPods in Ruby)
  • 主流現代:iOS 8+, dynamic framework only
@tmilos
tmilos / README.md
Last active May 13, 2024 02:36
Modified Preorder Tree Traversal

Modified Preorder Tree Traversal

Hierarchical data metrics that allows fast read operations on tree like structures.

Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.

Sample implementation

@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers