Skip to content

Instantly share code, notes, and snippets.

View ninjakx's full-sized avatar
🎯
Focusing

Kriti ninjakx

🎯
Focusing
View GitHub Profile
// We can use stl container list as a double
// ended queue to store the cache keys, with
// the descending time of reference from front
// to back and a set container to check presence
// of a key. But to fetch the address of the key
// in the list using find(), it takes O(N) time.
// This can be optimized by storing a reference
// (iterator) to each key in a hash map.
#include <bits/stdc++.h>
using namespace std;
@krishnadey30
krishnadey30 / GSoC_2019UnitTestFramework.md
Last active January 6, 2022 05:59
GSoC 2019 Unit Test Framework
@eddex
eddex / Install CUDA 10.1 on Ubuntu 18.04.md
Last active November 22, 2023 16:12
How to install CUDA 10.1 on Ubuntu 18.04

How to install CUDA 10.1 on Ubuntu 18.04

A clean installation of Ubuntu 18.04.02 LTS was used.

This gist is an extension to the official docs, adding missing parts and instructions.

2 pre-install actions

follow the pre-installation actions on:

@Mahedi-61
Mahedi-61 / cuda_11.8_installation_on_Ubuntu_22.04
Last active April 29, 2024 16:34
Instructions for CUDA v11.8 and cuDNN 8.9.7 installation on Ubuntu 22.04 for PyTorch 2.1.2
#!/bin/bash
### steps ####
# Verify the system has a cuda-capable gpu
# Download and install the nvidia cuda toolkit and cudnn
# Setup environmental variables
# Verify the installation
###
### to verify your gpu is cuda enable check
{"version":1,"resource":"file:///d%3A/Projects/axinan/b2c-id-web/src/__tests__/utils/common.test.ts","entries":[{"id":"rA8e.ts","source":"Workspace Edit","timestamp":1665658837123},{"id":"46ZA.ts","timestamp":1665658853345},{"id":"uFXv.ts","source":"Workspace Edit","timestamp":1666185864781}]}
@mozillazg
mozillazg / app.py
Created December 5, 2017 00:06
A simple demo for how to use flask-paginate.
from flask import Flask, render_template
from flask_paginate import Pagination, get_page_args
app = Flask(__name__)
app.template_folder = ''
users = list(range(100))
def get_users(offset=0, per_page=10):
@aortbals
aortbals / squash-and-merge-cli.md
Last active January 16, 2024 10:46
Squash and Merge on the Command line

With the introduction of GitHub's Squash and Merge feature, this has become less prevelant, however it's still useful in scenarios where GitHub's interface is unavailable.

Let's talk through two ways to do a squash and merge on the command line.

Take 1: Interactive Rebase

When to use it

  • When you have not merged main into your feature branch
  • There are no merge conflicts
@mGalarnyk
mGalarnyk / RegularizationStanfordCoursera.md
Created June 22, 2017 07:57
Machine Learning (Stanford) Coursera Logistic Regression Quiz (Week 3, Quiz 1) for the github repo: https://github.com/mGalarnyk/datasciencecoursera/tree/master/Stanford_Machine_Learning

Machine Learning Week 3 Quiz 2 (Regularization) Stanford Coursera

Github repo for the Course: Stanford Machine Learning (Coursera)
Quiz Needs to be viewed here at the repo (because the image solutions cant be viewed as part of a gist)

Question 1

True or False | Statement | Explanation

@cnaithani
cnaithani / Building pie chart with D3JS
Created April 3, 2017 17:51
Programming Central - D3JS – Pie Chart - Part 3
<style type="text/css">
#chart text {
fill: black;
font: 10px sans-serif;
text-anchor: end;
}
.axis text {
font: 10px sans-serif;
@pratos
pratos / gcloud_docker_setup.md
Last active January 12, 2023 18:26
Installing gcloud on Ubuntu 16.04 LTS

Installing it using cURL

$ curl https://sdk.cloud.google.com | bash

When the first time you run the above statement, it might be that you'll get the following error if python2 is not installed in your system.

Welcome to the Google Cloud SDK!
Traceback (most recent call last):
  File "/home/pratos/google-cloud-sdk/lib/third_party/enum/__init__.py", line 364, in __getattr__