Skip to content

Instantly share code, notes, and snippets.

@simrit1
simrit1 / intro.md
Created March 20, 2022 03:41 — forked from derhuerst/intro.md
Installing the Z Shell (zsh) on Linux, Mac OS X and Windows

Installing zsh – the easy way

The Z shell (zsh) is a Unix shell [...]. Zsh can be thought of as an extended Bourne shell with a large number of improvements, including some features of bash, ksh, and tcsh.

Z shell – Wikipedia

Read more about ZSH at An Introduction to the Z Shell.

Choose one of the following options.

@simrit1
simrit1 / binclock.py
Created March 18, 2022 05:14 — forked from psimonyi/binclock.py
A Python binary clock
#!/usr/bin/env python3
# Peter Simonyi 1 June 2012
'''A binary clock: prints the current time (HHMMSS) in binary-coded decimal.
Each BCD digit takes one column; least-significant bits are at the bottom.
Example: at 21:14:59 (local time):
000001
000110
100000
011011
@simrit1
simrit1 / clock.pde
Created March 18, 2022 05:13 — forked from companje/clock.pde
Arc Clock in Processing
float heleCirkel = TWO_PI; //tau
void setup() {
size(500,500);
background(0);
smooth();
}
void draw() {
background(0);
@simrit1
simrit1 / pythonchallenge-1to5.py
Created March 18, 2022 04:09 — forked from n9986/pythonchallenge-1to5.py
pythonchallenge.com solutions (1 to 5)
# I kept solving the puzzles until I reached the donation page. I give up. No dollars please.
################################################################################
# For challenge 5
def challenge5():
import pprint
import pickle
f = open('banner.p', 'rb')
@simrit1
simrit1 / LMC.py
Created March 15, 2022 07:28 — forked from shutebt01/LMC.py
Python LMC (Little Man Computer) Emulator
'''
Created on 22 Oct 2014
Little Man Computer Emulator
@author: shutebt01
'''
import tkinter
import sys
@simrit1
simrit1 / scrabble.py
Created March 14, 2022 18:01 — forked from Neeharika7/scrabble.py
scrabble game developed using python
def count_letters(word):
count = {}
for letter in word:
if letter not in count: count[letter] = 0
count[letter] += 1
return count
def spellable(word, rack):
word_count = count_letters(word)
rack_count = count_letters(rack)
@simrit1
simrit1 / raytracing.py
Created March 10, 2022 22:34 — forked from rossant/raytracing.py
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
@simrit1
simrit1 / README.md
Created March 10, 2022 22:34 — forked from sevko/README.md
simple Python raytracer

raytracer

A simple Python raytracer that supports spheres with configurable "material" properties (base color and a bunch of light coefficients). To generate a raytraced image of the pre-defined scene, run: python raytracer.py and open image.ppm with a PPM-compatible viewer (eog works fine on Linux):

raytraced spheres

acknowledgements

I found the following resources extremely helpful:

import numpy as np
import matplotlib.pyplot as plt
def normalize(vector):
return vector / np.linalg.norm(vector)
def reflected(vector, axis):
return vector - 2 * np.dot(vector, axis) * axis
def sphere_intersect(center, radius, ray_origin, ray_direction):
@simrit1
simrit1 / 00_nandgame.com_answer.adoc
Created March 10, 2022 22:14 — forked from orumin/00_nandgame.com_answer.adoc
Optimal answer for Nandgame.com

Invert

01 inv

And

02 and

Or