Skip to content

Instantly share code, notes, and snippets.

@denguir
denguir / cuda_install.md
Last active February 22, 2025 12:18
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

@adrians5j
adrians5j / s3PresignedPostDataExampleReact.js
Last active October 28, 2021 20:41
S3 pre-signed POST data example - React
import React from "react";
import Files from "react-butterfiles";
/**
* Retrieve pre-signed POST data from a dedicated API endpoint.
* @param selectedFile
* @returns {Promise<any>}
*/
const getPresignedPostData = selectedFile => {
return new Promise(resolve => {
@agounaris
agounaris / word_count_notebook.py
Created April 28, 2017 23:21
Word count of markdown jupyter notebook cells
import io
from IPython.nbformat import current
with io.open(filepath, 'r', encoding='utf-8') as f:
nb = current.read(f, 'json')
word_count = 0
for cell in nb.worksheets[0].cells:
if cell.cell_type == "markdown":
word_count += len(cell['source'].replace('#', '').lstrip().split(' '))
@mgoodness
mgoodness / helm-rbac.md
Last active October 30, 2021 17:04
Helm RBAC setup for K8s v1.6+ (tested on minikube)
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
@dkarchmer
dkarchmer / cognito-developer-authenticated-client-example.py
Last active October 11, 2024 16:44
django-boto3-cognito: AWS' Cognito Developer Authenticated Identities Authflow using Django/Python/Boto3 (For building stand-alone clients)
__author__ = 'dkarchmer'
'''
This script emulates a stand-alone Python based client. It relies on Boto3 to access AWS, but
requires your Django server to have an API for your user to access Cognito based credentials
Because of Cognito, the client (this script) will only get temporary AWS credentials associated
to your user and only your user, and based on whatever you configure your AIM Policy to be.
Most Cognito examples demonstrate how to use Cognito for Mobile Apps, so this scripts demonstrate
how to create a stand-alone Python script but operating similarly to these apps.
@aantipov
aantipov / sails_find_blueprint
Created February 24, 2015 19:57
Custom find blueprint for sails.js. Get total records count and sent it via X-Total-Count header
'use strict';
/**
* Module dependencies
*/
var actionUtil = require('sails/lib/hooks/blueprints/actionUtil'),
_ = sails.lodash;
var async = require('sails/node_modules/async');
/**
@whyrusleeping
whyrusleeping / gob.go
Created October 16, 2014 06:07
golang gob interface example
package main
import (
"bytes"
"encoding/gob"
"fmt"
)
type MyFace interface {
A()
@gitaarik
gitaarik / git_submodules.md
Last active February 27, 2025 21:14
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@rpip
rpip / tictactoe.py
Last active October 23, 2021 01:49
Simple Python implementation of the classic Tic Tac Toe game. Goal : Unbeatable AI.
#!/usr/bin/env python
#--------------------------------------------------------------------------
# Tic Tac Toe game in Python
# Author: Mawuli Adzaku <[email protected]>
# Date: 20-05-2013
# Tested with Python 2.7
# TO RUN:
# sudo chmod a+x tictactoe.py
# ./tictactoe.py
# OR JUST RUN : python tictactoe.py