Skip to content

Instantly share code, notes, and snippets.

@rhaglennydd
rhaglennydd / README.md
Last active May 4, 2024 17:47
Custom jQuery Build for a Webpack Flow

Custom jQuery Build for a Webpack Flow

Why?

Sometimes you don't need all of jQuery's modules. Officially, you can use their Grunt script to build a slimmed-down jQuery, but what if Webpack is more your thing? Enter this guide.

The Steps

  1. From your project root, install jQuery as a dev dependency:
@karpathy
karpathy / min-char-rnn.py
Last active May 4, 2024 17:44
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@BjoernSchilberg
BjoernSchilberg / README.md
Created June 17, 2018 19:10
Exporting an object as svg from inkscape
  1. Select the object(s) to export
  2. Open the document properties window (Ctrl+Shift+D)
  3. Select "Resize page to drawing or selection"
  4. File > Save As Copy...
  5. Select Optimized SVG as the format if you want to use it on the web
@saxbophone
saxbophone / float_test.c++
Last active May 4, 2024 17:39
Generate and verify safe ranges of integers for to-and-from float-int conversion
/*
* Written by Joshua Saxby ("saxbophone") 2023-03-14 -- saxbophone.com
*
* This demonstration program for how to derive max/min "safe" integers for
* conversion to and from floating point is hereby released into the public domain.
*/
#include <limits> // numeric_limits
#include <type_traits> // make_signed
@thomasjonas
thomasjonas / Dockerfile
Last active May 4, 2024 17:39
Dokku Dockerfile deployment for Create React App
# DISCLAIMER: This is probably not the best way to do it. This is just one way to make it work.
# There's 2 stages:
# - building the app
# - serving the app
# Build step
FROM node:10 as builder
# in case you want to use ENV variables you need to provide them as build-time configuration arguments
@Eathan3
Eathan3 / instalaciones-openai-react.md
Created May 4, 2024 17:37 — forked from Klerith/instalaciones-openai-react.md
Instalaciones recomendadas para el curso de OpenAI con React y Nest

OpenAI Logo

Instalaciones recomendadas

Curso de OpenAI con React y NestJS

Necesarias

VIDEOS MIGHT OUTDATED BUT TEXT IS NOT

this guide is not meant to help with leaking or any stupid things you might do to ruin experience for other people

Downloading

  • Get latest version from Github Actions not releases from here , if you dont have account you can use site like nightly.link to download it , Latest build
  • Extract zip file somewhere
chrome_bBlpF4CYiz.webm.mov

@ciiqr
ciiqr / zod-optional-null.ts
Last active May 4, 2024 17:36
zod optional/nullable/nullish differences
// zod schema
z.object({
// valid if string or:
optional: z.string().optional(), // field not provided, or explicitly `undefined`
nullable: z.string().nullable(), // field explicitly `null`
nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined`
});
// type
{
@jershell
jershell / baseLayout.kt
Created November 6, 2020 22:52
jetpack compose desktop base layout
package io.resound.ui.components
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.*
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
@Matt54
Matt54 / BlobView.Swift
Last active May 4, 2024 17:33
A fluid-like animating SwiftUI View
import SwiftUI
struct BlobView: View {
@State private var mainPosition: CGPoint = .zero
@State private var positions: [CGPoint] = []
private let blurRadius = 20.0
private let alphaThreshold = 0.875
private let ballCount = 20