Skip to content

Instantly share code, notes, and snippets.

@yauri-io
yauri-io / gist:8477112a589c6791b35c966291f87faa
Created January 7, 2019 13:51 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

@yauri-io
yauri-io / countries.json
Created July 22, 2019 20:23 — forked from erdem/countries.json
Country list as JSON format. fields: name, coordinates, timezones, country code and capital resource: https://github.com/mledoze/countries
[
{
"timezones": [
"America/Aruba"
],
"latlng": [
12.5,
-69.96666666
],
"name": "Aruba",
@yauri-io
yauri-io / nginx-tuning.md
Created February 22, 2020 21:34 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@yauri-io
yauri-io / taiwan district zip JSON array
Created May 30, 2020 18:53 — forked from abc873693/taiwan_districts.json
台灣行政區郵遞區號 JSON
[
{
"districts":[
{
"zip":"100",
"name":"中正區"
},
{
"zip":"103",
"name":"大同區"
@yauri-io
yauri-io / idea.vmoptions
Created August 12, 2020 12:12 — forked from ScriptedAlchemy/idea.vmoptions
improved perf vmoptions
-Xms1024m
-Xmx3072m
-Xss64m
-XX:ReservedCodeCacheSize=512m
-XX:+UseCompressedOops
-XX:NewRatio=2
-Dfile.encoding=UTF-8
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=250
-XX:NewSize=512m
@yauri-io
yauri-io / idea.properties
Last active April 21, 2021 22:33 — forked from ScriptedAlchemy/idea.propertie
custom IntelliJ IDEA properties
# custom IntelliJ IDEA properties
editor.zero.latency.typing=true
idea.max.intellisense.filesize=3500
idea.cycle.buffer.size=2048
@yauri-io
yauri-io / cors.nginxconf
Created September 15, 2021 19:21 — forked from bramswenson/cors.nginxconf
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
#
# Acts as a nginx HTTPS proxy server
# enabling CORS only to domains matched by regex
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/
#
# Based on:
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html
# * http://enable-cors.org/server_nginx.html
#
server {
@yauri-io
yauri-io / dialog-focus-restore.js
Created December 22, 2021 15:14 — forked from samthor/dialog-focus-restore.js
Restore focus after a HTML dialog is shown modally
/**
* Updates the passed dialog to retain focus and restore it when the dialog is closed. Won't
* upgrade a dialog more than once. Supports IE11+ and is a no-op otherwise.
* @param {!HTMLDialogElement} dialog to upgrade
*/
var registerFocusRestoreDialog = (function() {
if (!window.WeakMap || !window.MutationObserver) {
return function() {};
}
var registered = new WeakMap();
@yauri-io
yauri-io / gist:9ceb284fec487323cd66f7472d584545
Created March 6, 2022 19:42 — forked from kapkaev/gist:4619127
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. Resque
$ redis-cli
> config set stop-writes-on-bgsave-error no
@yauri-io
yauri-io / Compose - CustomWebView.kt
Created October 12, 2022 14:04 — forked from TheMelody/Compose - CustomWebView.kt
Jetpack Compose - WebView 使用方法
@Composable
fun CustomWebView(modifier: Modifier = Modifier,
url:String,
onBack: (webView:WebView?) -> Unit,
onProgressChange: (progress:Int)->Unit = {},
initSettings: (webSettings:WebSettings?) -> Unit = {},
onReceivedError: (error: WebResourceError?) -> Unit = {}){
val webViewChromeClient = object:WebChromeClient(){
override fun onProgressChanged(view: WebView?, newProgress: Int) {
//回调网页内容加载进度