Skip to content

Instantly share code, notes, and snippets.

View erfanium's full-sized avatar
👋
Never been too big, to not want to learn.

Erfan Safari erfanium

👋
Never been too big, to not want to learn.
View GitHub Profile
@denguir
denguir / cuda_install.md
Last active April 20, 2025 17:34
Installation procedure for CUDA / cuDNN / TensorRT

How to install CUDA / cuDNN / TensorRT on Ubuntu

Install NVIDIA drivers

Update & upgrade

sudo apt update && sudo apt upgrade

Remove previous NVIDIA installation

@ahbanavi
ahbanavi / iranian-banks-bin.json
Created March 18, 2021 11:10
Iranian banks cart number bin
[
{
"bank": "markazi",
"title": "اداره معاملات ریالی بانک مرکزی",
"bin": "636795"
},
{
"bank": "sanat",
"title": "بانک صنعت و معدن",
"bin": "627961"
@sindresorhus
sindresorhus / esm-package.md
Last active April 26, 2025 12:29
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@codenoid
codenoid / curl.sh
Last active September 22, 2022 20:31
Golang Upload -> Resize -> Return modified image
curl -F "[email protected]" http://localhost:8080/upload --output result.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsms
rsms / optional.ts
Created July 28, 2017 16:11
Make a TypeScript interface completely optional
// Optional declares a type of keyed type T where all keys are optional.
// This allows
type Optional<T> = { [P in keyof T]? :T[P] }
interface Foo {
x :number
y :number
}
type OptionalFoo = Optional<Foo>
@scokmen
scokmen / HttpStatusCode.ts
Created April 25, 2017 11:10
Typescript Http Status Codes Enum
"use strict";
/**
* Hypertext Transfer Protocol (HTTP) response status codes.
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
*/
enum HttpStatusCode {
/**
* The server has received the request headers and the client should proceed to send the request body
@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
@danharper
danharper / background.js
Last active April 29, 2025 04:09
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});