Skip to content

Instantly share code, notes, and snippets.

@ksopyla
ksopyla / install_cuda_11_ubuntu_2004.md
Last active October 16, 2024 07:58
How to install CUDA toolkit 11 at ubuntu 20.04

Step by step instruction how to install CUDA 11 Ubuntu 20.04

NVidia Ubuntu 20.04 repository for CUDA 11

If you need CUDA Tolkit 11 with nvcc, other tools and libraries you can install it from NVIDIA Ubunutu 20.04 repository.

Add Ubuntu 20.04 repository

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active October 15, 2024 09:13
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@qpwo
qpwo / monte_carlo_tree_search.py
Last active October 17, 2024 07:47
Monte Carlo tree search (MCTS) minimal implementation in Python 3, with a tic-tac-toe example gameplay
"""
A minimal implementation of Monte Carlo tree search (MCTS) in Python 3
Luke Harold Miles, July 2019, Public Domain Dedication
See also https://en.wikipedia.org/wiki/Monte_Carlo_tree_search
https://gist.github.com/qpwo/c538c6f73727e254fdc7fab81024f6e1
"""
from abc import ABC, abstractmethod
from collections import defaultdict
import math
@ilblackdragon
ilblackdragon / seq2seq.py
Last active May 22, 2022 21:42
Example of Seq2Seq with Attention using all the latest APIs
import logging
import numpy as np
import tensorflow as tf
from tensorflow.contrib import layers
GO_TOKEN = 0
END_TOKEN = 1
UNK_TOKEN = 2
@emilsoman
emilsoman / phoenix_to_umbrella
Last active July 13, 2024 21:50
How to move an existing phoenix app under an umbrella app
How to convert existing phoenix app to an umbrella app.
https://elixir-lang.slack.com/archives/phoenix/p1472921051000134
chrismccord [10:14 PM]
@alanpeabody yes, it's straightforward
[10:14]
1) mix new my_umbrella --umbrella
@bmtKIA6
bmtKIA6 / childModel.js
Created August 3, 2016 00:31 — forked from thecaddy/childModel.js
A sequelize plugin to support postgres inherited tables with models
//THIS MODEL INHERITS FROM THE OTHER TABLE
import inheritFrom form './inheritFrom'
import inherittedModel from './inherittedModel'
export default function(sequelize, DataTypes) {
const ChildModel = inheritFrom(sequelize, DataTypes)('childModel', inherittedModel, {
// define child model specific properties here
id: Sequelize.INTEGER,
some_model_id: Sequelize.INTEGER
@bulkan
bulkan / user.js
Created January 7, 2015 22:39
Mocking Sequelize model function
var Promise = require('bluebird');
var sinon = require('sinon');
var User = require('./db/models').User;
describe('User model', function(){
var userFindStub;
var sandbox;
before(function(){
sandbox = sinon.sandbox.create();