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 / 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) {
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]}
>
"""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
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})
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})
@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
#
@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 / palette_bmp.cpp
Last active July 15, 2022 15:04
OpenCV save image using indexed color (palette color)
#include "palette_bmp.hpp"
#include "pch.hpp"
#include "utils.hpp"
using namespace std;
using namespace cv;
// NOTE good articles
// 1. https://blog.csdn.net/u012877472/article/details/50272771
// 2. https://www.cnblogs.com/Matrix_Yao/archive/2009/12/02/1615295.html
@fzyzcjy
fzyzcjy / simpleperf_beautify.js
Last active October 27, 2021 10:30
Beautify simpleperf html report by coloring it
let HIGHLIGHT_CODE = 'vision_utils';
let style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = `
.tom-blue-bg { background: #03a9f410; }
.tom-green { background: #4caf5050; }
.tom-orange { background: #ff980050; }
`;
style.id = "tom-inject-css";
@fzyzcjy
fzyzcjy / README.md
Last active April 26, 2022 14:24
Some pull requests to Flutter
  1. Fixing bug when ListenableEditingState is provided initialState with a valid composing range, android.view.inputmethod.BaseInputConnection.setComposingRegion(int, int) has NPE flutter/engine#30916
  2. Fix FollowerLayer (CompositedTransformFollower) has null pointer error when using with some kinds of Layers flutter/flutter#100672
  3. Create ImageFilter.dilate/ImageFilter.erode flutter/engine#32334