Skip to content

Instantly share code, notes, and snippets.

View wandonye's full-sized avatar

Danny Wang wandonye

View GitHub Profile
@cgmb
cgmb / CMakeLists.txt
Last active December 4, 2023 03:58
Setup ROCm on a G4ad instance
cmake_minimum_required(VERSION 3.16)
project(example LANGUAGES CXX)
find_package(hip REQUIRED)
add_executable(example main.cpp)
target_link_libraries(example PRIVATE hip::device)
@biggzlar
biggzlar / cuda_installation_on_ubuntu_18.04
Last active March 7, 2021 16:03 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
tensorflow-gpu and nvidia rtx 2060 / 2070 / 2080
#!/bin/bash
## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
@xavierpriour
xavierpriour / build.sh
Created May 7, 2018 15:01
meteor-in-docker production - build script
#!/usr/bin/env bash
#
# Builds the docker image used in deployments.
# - embedding most files inside the image
# - turning on compilation and optimization
# - this requires the dev image as a tool (will pull it if not already available)
#
# This WILL wipe out any previous build and replace with a new one
# fetch build info to embed in the image
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 4, 2024 11:33
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zhanwenchen
zhanwenchen / Install NVIDIA Driver and CUDA.md
Last active March 13, 2024 23:42 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA CUDA 9.0 on Ubuntu 16.04.4 LTS
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@seanmckaybeck
seanmckaybeck / remote_servo.ino
Last active June 7, 2018 07:45
Remote control servo with Particle Photon. Apache License, copyright 2015 Sean Beck
Servo serv;
int pos = 0;
void setup() {
serv.attach(D0);
Spark.function("setpos", setPos);
Spark.variable("getpos", &pos, INT);
}
void loop() {
@bogger
bogger / deploy.prototxt
Last active May 28, 2022 21:55
GoogLeNet_cars
name: "GoogleNet"
input: "data"
input_dim: 10
input_dim: 3
input_dim: 224
input_dim: 224
# hierarchy 1
# conv -> relu -> pool -> lrn
@derricw
derricw / rebin_ndarray.py
Created April 9, 2015 15:46
Rebin an arbitrary numpy ndarray in N dimensions
import numpy as np
def bin_ndarray(ndarray, new_shape, operation='sum'):
"""
Bins an ndarray in all axes based on the target shape, by summing or
averaging.
Number of output dimensions must match number of input dimensions.
Example