Skip to content

Instantly share code, notes, and snippets.

View EvanMu96's full-sized avatar
🐟
touch fish.go

Sen EvanMu96

🐟
touch fish.go
View GitHub Profile
@fmela
fmela / stacktrace.cxx
Last active September 22, 2023 10:58
A C++ function that produces a stack backtrace with demangled function & method names.
/*
* Copyright (c) 2009-2017, Farooq Mela
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
@gizmaa
gizmaa / Plot_Examples.md
Last active June 10, 2024 02:44
Various Julia plotting examples using PyPlot
@jcouyang
jcouyang / learnjulia.jl
Last active May 23, 2020 10:20
Y 分钟学 Julia
# 单行注释只需要一个井号
#= 多行注释
只需要以 '#=' 开始 '=#' 结束
还可以嵌套.
=#
####################################################
## 1. 原始类型与操作符
####################################################
@vxgmichel
vxgmichel / udpproxy.py
Created February 2, 2017 10:05
UDP proxy server using asyncio
"""UDP proxy server."""
import asyncio
class ProxyDatagramProtocol(asyncio.DatagramProtocol):
def __init__(self, remote_address):
self.remote_address = remote_address
self.remotes = {}
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active July 25, 2024 15:41
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@jonathan-kosgei
jonathan-kosgei / timer.py
Last active June 14, 2021 05:01
Python Decorator to Time a Function
""" A simple decorator that times the duration of a function's execution. More info on Decorators at https://pythonconquerstheuniverse.wordpress.com/2009/08/06/introduction-to-python-decorators-part-1/"""
import timeit
def timer(function):
def new_function():
start_time = timeit.default_timer()
function()
elapsed = timeit.default_timer() - start_time
print('Function "{name}" took {time} seconds to complete.'.format(name=function.__name__, time=elapsed))
return new_function()
@qinjian623
qinjian623 / onnx2pytorch.py
Last active November 8, 2023 08:21
ONNX file to Pytorch model
import onnx
import struct
import torch
import torch.nn as nn
import torchvision as tv
import warnings
# enum DataType {
# UNDEFINED = 0;