Skip to content

Instantly share code, notes, and snippets.

View saurabheights's full-sized avatar

Saurabh Khanduja saurabheights

View GitHub Profile
@VKen
VKen / docker-start-celery-multi-worker-entrypoint
Created September 19, 2019 03:57
Running celery multi in docker container with running logs, signal trap, and graceful shutdown & restart
#!/bin/sh
# safety switch, exit script if there's error. Full command of shortcut `set -e`
set -o errexit
# safety switch, uninitialized variables will stop script. Full command of shortcut `set -u`
set -o nounset
# tear down function
teardown()
{
@crapthings
crapthings / docker-compose.yml
Last active November 20, 2022 12:31
docker-compose rs init
version: '3'
services:
mongo1:
hostname: mongo1
container_name: localmongo1
image: mongo
restart: always
expose:
- 27017
ports:
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import Dataset
from torch.utils.data.dataloader import DataLoader
@Ricket
Ricket / gist:78bcd681db86bcbb134558428c4c6cb4
Created September 25, 2018 16:54
git diff -- use jq to pretty-print the json before diffing it
echo "*.json diff=json" >> ~/.gitattributes
git config --global core.attributesfile ~/.gitattributes
git config --global diff.json.textconv "jq '.' \$1"
FROM nvidia/cuda:9.0-base-ubuntu16.04
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cuda-command-line-tools-9-0 \
cuda-cublas-dev-9-0 \
cuda-cudart-dev-9-0 \
cuda-cufft-dev-9-0 \
cuda-curand-dev-9-0 \
cuda-cusolver-dev-9-0 \
@etienne87
etienne87 / torch_bilateral_gray.py
Created March 22, 2018 07:51
how to make a bilateral filter using torch
#!/usr/bin/python
# torch_bilateral: bi/trilateral filtering in torch
import torch
from torch import nn
from torch.autograd import Variable
import torch.nn.functional as F
from torch.nn import Parameter
import numpy as np
import pdb
import time
@PCreations
PCreations / rxjs-diagrams.md
Last active September 26, 2024 01:44
Super Intuitive Interactive Diagrams to learn combining RxJS sequences by Max NgWizard K
@thibaudruelle
thibaudruelle / Add_reg_keys-Anaconda_Prompt_Here.bat
Created November 30, 2017 08:46
Run as admin to add "Anaconda Prompt Here" to context menu. See https://stackoverflow.com/a/46803585/1291711.
REG ADD HKCR\Directory\Background\shell\Anaconda\ /ve /f /d "Anaconda Prompt Here"
REG ADD HKCR\Directory\Background\shell\Anaconda\ /v Icon /f /t REG_EXPAND_SZ /d %%USERPROFILE%%\\Anaconda3\\Menu\\Iconleak-Atrous-Console.ico
REG ADD HKCR\Directory\Background\shell\Anaconda\command /f /ve /t REG_EXPAND_SZ /d "%%USERPROFILE%%\\Anaconda3\\pythonw.exe %%USERPROFILE%%\\Anaconda3\\cwp2.py %%USERPROFILE%%\\Anaconda3 %%V cmd.exe /K %%USERPROFILE%%\\Anaconda3\\Scripts\\activate.bat %%USERPROFILE%%\\Anaconda3"
REG ADD HKCR\Directory\shell\Anaconda\ /ve /f /d "Anaconda Prompt Here"
REG ADD HKCR\Directory\shell\Anaconda\ /v Icon /f /t REG_EXPAND_SZ /d %%USERPROFILE%%\\Anaconda3\\Menu\\Iconleak-Atrous-Console.ico
REG ADD HKCR\Directory\shell\Anaconda\command /f /ve /t REG_EXPAND_SZ /d "%%USERPROFILE%%\\Anaconda3\\pythonw.exe %%USERPROFILE%%\\Anaconda3\\cwp2.py %%USERPROFILE%%\\Anaconda3 %%V cmd.exe /K %%USERPROFILE%%\\Anaconda3\\Scripts\\activate.bat %%USERPROFILE%%\\Anaconda3"
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\Anaconda]
"Icon"="%USERPROFILE%\\Anaconda3\\Menu\\Iconleak-Atrous-Console.ico"
@="Open Anaconda Prompt here"
[HKEY_CLASSES_ROOT\Directory\Background\shell\Anaconda\command]
@="C:\\Users\\bdforbes\\Anaconda3\\pythonw.exe C:\\Users\\bdforbes\\Anaconda3\\cwp2.py C:\\Users\\bdforbes\\Anaconda3 \"%V \" cmd.exe \"/K\" C:\\Users\\bdforbes\\Anaconda3\\Scripts\\activate.bat C:\\Users\\bdforbes\\Anaconda3"
[HKEY_CLASSES_ROOT\Directory\shell\Anaconda]
@arichardson
arichardson / CLion_Ninja.md
Last active January 25, 2024 15:23 — forked from nevkontakte/CLion_Ninja.md
Ninja support for CLion IDE

Ninja support for CLion IDE (working with newer versions of clion)

This script enables Ninja-powered builds in CLion IDE by wrapping around CMake, which it uses. See my blog post for details.

Disclaimer

This script is provided AS IS with no guarantees given or responsibilities taken by the author. This script relies on undocumented features of CLion IDE and may lead to instability of build and/or IDE. Use it on your own risk under WTFPL terms.