Skip to content

Instantly share code, notes, and snippets.

View darkpiv's full-sized avatar

Nhất Hoàng darkpiv

View GitHub Profile
from fastapi import FastAPI
import uvicorn
from sklearn.pipeline import make_pipeline
from sklearn.ensemble import RandomForestClassifier
from sklearn.pipeline import Pipeline
from pydantic import BaseModel
import pandas as pd
from sklearn.impute import SimpleImputer
from sklearn.base import BaseEstimator, TransformerMixin

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@darkpiv
darkpiv / cloudSettings
Last active August 8, 2020 04:08
vs-code
{"lastUpload":"2020-08-08T04:08:06.601Z","extensionVersion":"v3.4.3"}
@darkpiv
darkpiv / proguard-rules.pro
Created June 18, 2019 07:01 — forked from jemshit/proguard-rules.pro
Proguard rules for common Android libraries
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
### RxJava, RxAndroid (https://gist.github.com/kosiara/487868792fbd3214f9c9)
-keep class rx.schedulers.Schedulers {
public static <methods>;
@darkpiv
darkpiv / fix_onedrive.sh
Created October 9, 2018 01:47 — forked from drblue/fix_onedrive.sh
Fix OneDrive for Mac CPU usage
#!/bin/bash
find ~/Library/Group\ Containers/ -type d -name OfficeFileCache -exec rm -r {} +
@darkpiv
darkpiv / NoBounceBehavior.java
Created August 17, 2018 04:27 — forked from ampatron/NoBounceBehavior.java
Custom behavior to prevent v26 AppBar support from bouncing when scrolling
public class NoBounceBehavior extends AppBarLayout.Behavior {
private static final int TYPE_FLING = 1;
...
@Override
public boolean onInterceptTouchEvent(CoordinatorLayout parent, AppBarLayout child, MotionEvent ev) {
if (isFlinging) {
shouldBlockNestedScroll = true;
}
return super.onInterceptTouchEvent(parent, child, ev);
@darkpiv
darkpiv / postgres-cheatsheet.md
Created November 20, 2017 17:18 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)