Skip to content

Instantly share code, notes, and snippets.

View sushant94's full-sized avatar
💭
💻

Sushant Dinesh sushant94

💭
💻
View GitHub Profile
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active April 23, 2024 02:03
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
require 'pty'
require 'fileutils'
def execmd cmd
begin
PTY.spawn(cmd) do |r, w, pid|
begin
r.each { |line| print line;}
rescue Errno::EIO
end
extern crate libc;
use libc::{ c_void };
use std::env;
fn atoi(k: &str) -> i32 {
match k.parse::<i32>() {
Ok(val) => val,
Err(_) => 0
}
@atheriel
atheriel / macroexpand.c
Last active January 20, 2018 07:58
Can one write a Python extension in Rust?
PyObject * RustPy_InitModule(const char *name, PyMethodDef *methods, const char *doc) {
// return Py_InitModule4(name, methods, doc, (PyObject *) NULL, PYTHON_API_VERSION);
return Py_InitModule3(name, methods, doc);
}