Skip to content

Instantly share code, notes, and snippets.

View cristicmf's full-sized avatar
🌴
On vacation

Cristic cristicmf

🌴
On vacation
View GitHub Profile
@cristicmf
cristicmf / Keras-预训练-冻结-微调
Created October 10, 2021 17:45 — forked from lartpang/Keras-预训练-冻结-微调
Keras预训练模型/按需分配显存/冻结层/独热编码解码输出/写文件/IoU/导出xml
#!/usr/bin/env python
import os
import tensorflow as tf
import keras.backend.tensorflow_backend as KTF
import numpy as np
from keras.layers import Dense, GlobalAveragePooling2D
from keras.models import Model
from keras.optimizers import Adam
from keras.preprocessing import image
@cristicmf
cristicmf / GitHub-Forking.md
Created May 21, 2019 02:35 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@cristicmf
cristicmf / grafana-dashboard-exporter
Created January 8, 2019 02:31 — forked from crisidev/grafana-dashboard-exporter
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done
contract Function_hook_example {
function Function_hook_example() {
owner = msg.sender;
}
modifier isOwner {
if (msg.sender == owner) {
_
}
/**
* Base contract that all upgradeable contracts should use.
*
* Contracts implementing this interface are all called using delegatecall from
* a dispatcher. As a result, the _sizes and _dest variables are shared with the
* dispatcher contract, which allows the called contract to update these at will.
*
* _sizes is a map of function signatures to return value sizes. Due to EVM
* limitations, these need to be populated by the target contract, so the
* dispatcher knows how many bytes of data to return from called functions.
@cristicmf
cristicmf / Database.sol
Created September 27, 2017 02:28 — forked from tjade273/Database.sol
Example of separated storage and logic
contract Database{
mapping(uint => uint) public _data;
mapping(address => bool) _owners;
function Database(address[] owners){ //Called once at creation, pass in initial owners
for(uint i; i<owners.length; i++){
_owners[owners[i]]=true;
}
}
@cristicmf
cristicmf / Back to the present???.markdown
Created October 22, 2015 09:41
Back to the present???