Skip to content

Instantly share code, notes, and snippets.

@jamesgregson
jamesgregson / arap.py
Last active March 17, 2023 22:10
Python ARAP mesh deformation
from typing import *
import time
import numpy as np
import scipy.sparse as sparse
import scipy.sparse.linalg as spla
def build_cotan_laplacian( points: np.ndarray, tris: np.ndarray ):
a,b,c = (tris[:,0],tris[:,1],tris[:,2])
A = np.take( points, a, axis=1 )
B = np.take( points, b, axis=1 )
@stramel
stramel / HOWTO.md
Last active May 30, 2024 21:53
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 RemoteSigned [1]
  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
@nweddle
nweddle / agnoster-newline.zsh-theme
Created March 11, 2016 21:25
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
@fizerkhan
fizerkhan / gist:41f9c525db5b3b16bfcb
Last active March 28, 2023 19:54
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

@willemo
willemo / passwordless-ssh.md
Last active November 22, 2022 12:46
Passwordless SSH/SFTP access to a server

Passwordless SSH/SFTP for dummies

To get SSH or SFTP access to a server without using a password you need to have a SSH key pair for each computer you want to be able to access the server from. In this document I’ll describe the steps you need to take to generate a key pair if you don’t have one already. If you do, you can use your public key(s) to get access to the server.

I'll also explain how to connect to your server using Cyberduck. Click here to skip to that part.

Disclaimer and stuff

This guide is written with newbies in mind, so I'm very thorough in describing the steps that you must take. This guide will not cover setting up the server side of this system. It assumes that there's a server running with SSH enabled.

@Kartones
Kartones / postgres-cheatsheet.md
Last active June 26, 2024 18:01
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)
@rossant
rossant / raytracing.py
Last active June 25, 2024 20:58
Very simple ray tracing engine in (almost) pure Python. Depends on NumPy and Matplotlib. Diffuse and specular lighting, simple shadows, reflections, no refraction. Purely sequential algorithm, slow execution.
"""
MIT License
Copyright (c) 2017 Cyrille Rossant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: