Skip to content

Instantly share code, notes, and snippets.

View fzyzcjy's full-sized avatar
😄
Hello, world!\n

fzyzcjy fzyzcjy

😄
Hello, world!\n
  • +=1 (seriously this is the name)
  • Solar system
View GitHub Profile
@fzyzcjy
fzyzcjy / dash_url_helper.py
Created March 11, 2021 04:04
Save states in url for Plotly Dash
import ast
import re
from typing import Dict, Callable, Any
from urllib.parse import urlparse, parse_qsl, urlencode, quote
import dash
from dash.dependencies import Input, Output, ALL
_COMPONENT_ID_TYPE = 'url_helper'
@fzyzcjy
fzyzcjy / go-test-many.sh
Created November 18, 2020 12:51 — forked from jonhoo/go-test-many.sh
Script for running go tests many times in parallel, printing the current status, and logging errors
#!/bin/bash
#
# Script for running `go test` a bunch of times, in parallel, storing the test
# output as you go, and showing a nice status output telling you how you're
# doing.
#
# Normally, you should be able to execute this script with
#
# ./go-test-many.sh
#
cmake_minimum_required(VERSION 3.4.1) # for example
# TODO please change me!
set(OPENCV_BASE_DIR "TODO PLEASE PUT YOUR DIR HERE!!!")
set(OPENCV_INCLUDE_DIR "${OPENCV_BASE_DIR}/sdk/native/jni/include/")
set(OPENCV_STATIC_LIB_DIR "${OPENCV_BASE_DIR}/sdk/native/staticlibs/${ANDROID_ABI}")
set(OPENCV_3RDPARTY_STATIC_LIB_DIR "${OPENCV_BASE_DIR}/sdk/native/3rdparty/libs/${ANDROID_ABI}")
include_directories(${OPENCV_INCLUDE_DIR})
cmake_minimum_required(VERSION 3.4.1)
# TODO please change me!
set(OPENCV_BASE_DIR "TODO PLEASE PUT YOUR DIR HERE!!!")
set(OPENCV_INCLUDE_DIR "${OPENCV_BASE_DIR}/sdk/native/jni/include/")
set(OPENCV_STATIC_LIB_DIR "${OPENCV_BASE_DIR}/sdk/native/staticlibs/${ANDROID_ABI}")
set(OPENCV_3RDPARTY_STATIC_LIB_DIR "${OPENCV_BASE_DIR}/sdk/native/3rdparty/libs/${ANDROID_ABI}")
include_directories(${OPENCV_INCLUDE_DIR})
"""MobileNet v3 models for Keras.
# Reference
[Searching for MobileNetV3](https://arxiv.org/abs/1905.02244?context=cs)
"""
from keras.layers import Conv2D, DepthwiseConv2D, Dense, GlobalAveragePooling2D
from keras.layers import Activation, BatchNormalization, Add, Lambda, Reshape, Layer, InputSpec, Multiply
from keras.utils import conv_utils
from keras.backend.common import normalize_data_format
render() {
if (!this.state.rendered) return null;
const { children, dismissable } = this.props;
return (
<Animated.View
accessibilityViewIsModal
accessibilityLiveRegion="polite"
style={[{ opacity: this.state.opacity }, styles.wrapper]}
>
@fzyzcjy
fzyzcjy / helpers.php
Last active July 22, 2018 03:12
Cache Control for Laravel Response
<?php
function addResponseHeaders($request, $response, $ext, $modifiedTimestamp, $downloadFileName = null)
{
$mime = ExtToMIME::convert($ext);
$headers = &$response->headers;
$headers->set('Content-Type', $mime, true);
$headers->set('Cache-Control', 'public', true); // TODO max-age=xxx
$headers->set('Last-Modified', gmdate("D, d M Y H:i:s", $modifiedTimestamp) . " GMT", true);
if ($downloadFileName != null) {