Skip to content

Instantly share code, notes, and snippets.

@hminle
hminle / DeSurv.py
Last active January 5, 2024 17:31
DeSurv
import torch
import numpy as np
import torch.nn as nn
from nfg.nfg_torch import *
from nfg.nfg_api import NeuralFineGray
class DeSurv(NeuralFineGray):
@hminle
hminle / gist:220670fde696adeb7699f683983d7fcb
Created March 24, 2023 05:45 — forked from fizerkhan/gist:41f9c525db5b3b16bfcb
RSA Host Key has been changed.

Solution for RSA host key for <ip_address> has changed and you have requested strict checking:

Method 1: Remove keys

ssh-keygen -R <server_name>

(or)

ssh-keygen -R

@hminle
hminle / agnoster-newline.zsh-theme
Created September 6, 2022 14:46 — forked from nweddle/agnoster-newline.zsh-theme
Agnoster ZSH Theme with New Line
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
@hminle
hminle / HOWTO.md
Created July 28, 2022 16:49 — forked from stramel/HOWTO.md
Installing Powerline fonts on Windows 10

Installing Powerline fonts on Windows 10

Steps

  1. Download and extract zip from here
  2. Press Windows + x
  3. Press a (Selects PowerShell (Admin))
  4. Navigate to directory where fonts were extracted to (cd ${HOME}\Downloads\fonts-master\fonts-master)
  5. Set Execution policy Set-ExecutionPolicy Bypass
  6. Press y then Enter to accept
Process for setting up github pages with namecheap domain.
1. Go to namecheap.com, select and buy domain name.
2. Login to namecheap, go to username drop down and select dashboard.
3. Go to DomainList
4. Click manage button
5. Click Advanced DNS tab
6. Click add record and add three records:
Type: A Record | Host: @ | Value: 192.30.252.153 | TTL: Automatic
@hminle
hminle / merge_pdf.py
Created November 3, 2021 13:35
merge pdf files in a given path with password. Replace your <path> and <password> to use
import PyPDF2
from pathlib import Path
root = Path(r"<path>")
pdf_files = list(root.glob('*.pdf'))
writer = PyPDF2.PdfFileWriter()
for file in pdf_files:
with open(file, mode='rb') as f:
reader = PyPDF2.PdfFileReader(f)
@hminle
hminle / postgres-cheatsheet.md
Created June 19, 2019 04:02 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@hminle
hminle / Utils.scala
Last active December 8, 2016 00:55
Utils.scala
package externalsorting
import java.io.{BufferedOutputStream, File, FileOutputStream}
import java.nio.ByteBuffer
import java.nio.channels.FileChannel
import java.nio.file.Paths
import readInput._
import scala.annotation.tailrec
@hminle
hminle / ChannelServer.scala
Created November 28, 2016 08:43
This is channel server I implemented using java nio in Scala, which can accept connection from clients and respond to their requests
import java.io.IOException
import java.net.InetSocketAddress
import java.nio.ByteBuffer
import java.nio.channels.{SelectionKey, Selector, ServerSocketChannel, SocketChannel}
import java.util
import com.typesafe.scalalogging.Logger
import org.slf4j.LoggerFactory
object ChannelSever {