Skip to content

Instantly share code, notes, and snippets.

View rcholic's full-sized avatar

Tony Wang rcholic

View GitHub Profile
@JaimeStill
JaimeStill / README.md
Last active January 12, 2024 04:44
ASP.NET Core Active Directory Integration

Active Directory Authentication

This will provide an example of integrating Active Directory authentication in an ASP.NET Core app.

Note, you'll need to be running on a Windows domain with Visual Studio debugging in IIS Express for this to work.

Setup

In launchSettings.json, you'll want to modify iisSettings by turning on windowsAuthentication:

@calosth
calosth / UIView+Intersection.swift
Last active September 8, 2022 22:59
Extension of UIView to detect collisions between them, including rotated(transformed) views.
import UIKit
// Conform the `Polygon` protocol to specify the vertices of the polygon.
protocol Polygon {
var vertices: [CGPoint] { get }
}
// UIView conforms the protocol `Polygon` to specified the vertices of the rectangle.
extension UIView: Polygon {
@rizerzero
rizerzero / aws.py
Created January 7, 2019 10:17 — forked from philkuz/aws.py
check S3 bucket exists with python
from aws import bucket_exists, upload_path
bucket_name = 'cnns-music-vids'
directory_to_upload = 'data/'
output_s3_directory = 'data/'
if bucket_exists(bucket_name):
print('the bucket exists!')
else:
raise ValueError('nah the bucket does not exist')
@miguelmota
miguelmota / Dockerfile
Last active July 19, 2022 10:53
Dockefile golang go get private repo
FROM golang:latest
# ...
RUN mkdir -p $GOROOT/src/github.com/MY_ORG
# fetch private repo example
RUN git clone -b go https://MY_AUTH_TOKEN:x-oauth-basic@github.com/MY_ORG/MY_REPO.git $GOPATH/src/github.com/MY_ORG/MY_REPO
# go get public repo example

Dev setup for Kafka and Spark Streaming

This note is for setting up rapid prototyping of MongoDB -> Kafka -> Spark Streaming pipeline.

Pyspark is being used for fast turn around. Pyspark uses Kafka connector that uses ZooKeeper so the topic has to be created with offsets stored in ZooKeeper.

Prerequisites

$> brew install zookeeper kafka apache-spark jupyter
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Animated, //使用Animated组件
Easing, //引入Easing渐变函数
} from 'react-native';
@vasanthk
vasanthk / System Design.md
Last active March 29, 2024 06:27
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@hassy
hassy / parse_aws.md
Last active January 17, 2024 04:11
Deploying Parse Server on AWS (WIP)

Deploying Parse Server on AWS

Note: this is a work-in-progress and will be updated with more information over the next few days.

Intro

This guide will walk you through deploying your own instance of the open-source Parse Server. This would be a good starting point for testing your existing application to see if the functionality provided by the server is enough for your application, and to potentially plan your migration off the Parse Platform.

This guide will walk you through using Elastic Beanstalk (EB), which is an AWS service similar to Heroku. Why use EB rather than Heroku? Elastic Beanstalk does not lock you into Heroku-specific ways of doing things, is likely cheaper to run your backend on than Heroku, and it integrates with other services that AWS offer (and they offer almost everything one needs to run an application these days).

@nrollr
nrollr / MySQL.md
Last active October 28, 2020 02:53
Install MySQL on El Capitan using Homebrew

Install MySQL on OS X El Capitan

Normally the installation of MySQL can be achieved with a single command, which executes a script provided by MacMiniVault : bash <(curl -Ls http://git.io/eUx7rg)

However, at the time of writing the script is not compatible with OS X El Capitan (10.11)

Install MySQL using Homebrew

An alternative to the aforementioned installation script is installing MySQL using Homebrew. This gist assumes you already have Homebrew installed, if not first read the article "Homebrew and El Capitan"

Make sure Homebrew has the latest formulae, so run brew update first

var Col = require('react-bootstrap/lib/Col')
var PageHeader = require('react-bootstrap/lib/PageHeader')
var React = require('react')
var Row = require('react-bootstrap/lib/Row')
var {connect} = require('react-redux')
var {reduxForm} = require('redux-form')
var DateInput = require('./DateInput')
var FormField = require('./FormField')
var LoadingButton = require('./LoadingButton')