Skip to content

Instantly share code, notes, and snippets.

@deanputney
deanputney / twilight_matplotlib.py
Created February 11, 2025 19:01
Twilight Matplotlib
## From: https://www.reddit.com/r/generative/comments/1imyi7b/comment/mc6vx7c/
#!/usr/bin/env python3
# coding: utf-8
import matplotlib.pyplot as plt
import numpy as np
def main():
X, Y = np.meshgrid(
np.linspace(-1, 1, 500),
@faustinoaq
faustinoaq / myAngular.html
Last active October 21, 2025 00:43
Front-end libraries (React, Vue, Angular) and the basic principles of how they work, all in a single file using pure JavaScript (VanillaJS).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Angular from Scratch</title>
<style>
.my-component {
font-family: Arial, sans-serif;
1 acorn: A Leiningen template for a ClojureScript setup with Figwheel, Austin, Om.
8 amp: Leiningen template for AMP (Alfresco Module Package) projects.
1 angular-cl2: A Leiningen template for using AngularJS and ChlorineJS
1 angular: Clojure and AngularJS in perfect harmony.
6 angular: Clojure and AngularJS in perfect harmony. $ lein new angular <name>
2 angularjs-app: Leiningen template for web application with http-kit and angularjs
5 angular-simple: Clojure and AngularJS $ lein new angular-simple <name>
1 aperiodic-cljs: My cljs development starting point. Basically ripped from lein-cljsbuild.
1 apijr: clojurescript project template
1 appfgo: 'lein new' template for Funcgo application
// Commented version of https://twitter.com/zozuar/status/1441384708441456651
// Google-translated (with some editing) from @gam0022's version
float i, // Ray marching loop counter
e, // Volume density (the smaller the value, the higher the density)
s, // FBM scale (and loop counter)
g, // Ray's distance (also used for tunnel twirl and camera prespective)
k = .01; // Handy constant
// Ray marching loop
@rickkk856
rickkk856 / Drawing_App.py
Last active May 17, 2024 03:38
Drawing Interface For Google Colaboratory - Paint
#@title <font color='red'>Drawing APP</font> {vertical-output: true, run: "auto"}
import ipywidgets as widgets
from ipywidgets import Layout, Button, Box
from IPython.display import display, HTML, Image
from google.colab.output import eval_js
from base64 import b64decode
Square_Size = 256 #@param ["256", "512"] {type:"raw"}
Brush_Size = 30 #@param {type:"slider", min:0, max:100, step:5}
@wzjoriv
wzjoriv / clustering.py
Last active August 11, 2024 20:47
Nearest Neighbor, K Nearest Neighbor and K Means (NN, KNN, KMeans) implemented only using PyTorch
import torch as th
"""
Author: Josue N Rivera (github.com/wzjoriv)
Date: 7/3/2021
Description: Snippet of various clustering implementations only using PyTorch
Full project repository: https://github.com/wzjoriv/Lign (A graph deep learning framework that works alongside PyTorch)
"""
def random_sample(tensor, k):
<!--
Go to Line 153 for the start of Uniform Buffer Object related code and intro
Prerequsite:
You at least know what uniforms are in the context of WebGL
and mininally understand the concepts involved in creating a square in WebGL
-->
<html>
@homfarnam
homfarnam / Next Js _document.js
Created March 3, 2021 11:05
Next Js _document.js - styled component
import Document, { Html, Head, Main, NextScript } from "next/document"
import { ServerStyleSheet, createGlobalStyle } from "styled-components"
const GlobalStyle = createGlobalStyle`
body {
padding: 0;
margin: 0;
}
`
class MyDocument extends Document {
static async getInitialProps(ctx) {
@windwp
windwp / media_preview.lua
Last active May 7, 2025 04:14
telescope media preview
local utils = require('telescope.utils')
local defaulter = utils.make_default_callable
local actions = require('telescope.actions')
local finders = require('telescope.finders')
local make_entry = require('telescope.make_entry')
local pickers = require('telescope.pickers')
local previewers = require('telescope.previewers')
local builtin = require('telescope.builtin')
local conf = require('telescope.config').values
local flatten = vim.tbl_flatten
@skeeto
skeeto / README.md
Last active September 23, 2024 02:16
AI driving simulation