Skip to content

Instantly share code, notes, and snippets.

View Dobby233Liu's full-sized avatar

Liu Wenyuan Dobby233Liu

View GitHub Profile
@mrdoob
mrdoob / RequestAnimationFrame.js
Created February 22, 2011 14:50
Provides requestAnimationFrame in a cross browser way.
/**
* Provides requestAnimationFrame in a cross browser way.
* @author paulirish / http://paulirish.com/
*/
if ( !window.requestAnimationFrame ) {
window.requestAnimationFrame = ( function() {
return window.webkitRequestAnimationFrame ||
@kylemcdonald
kylemcdonald / oneliner.fs
Created November 12, 2011 14:24
one liner
/*
GLSL fragment shader implementing the one line synthesis pattern.
http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
*/
#extension GL_EXT_gpu_shader4 : enable
const int width = 512; // assumes you're drawing at 512x512
void main() {
int t = int(gl_FragCoord.y) * width + int(gl_FragCoord.x);
int c = t*5&(t>>7)|t*3&(t*4>>10);// miiro
@drhelius
drhelius / GameBoy Color Boot ROM Disassembly
Last active March 1, 2024 10:30
GameBoy Color Boot ROM Disassembly
; GameBoy Color Boot ROM Disassembly
; Dumped by Costis
; Commenting by Randy Mongenel (Duo)
; WORK-IN-PROGRESS VERSION 09-27-2009
; ===========================================================================
; Segment type: Pure code
SECTION "ROM", CODE
@yangshun
yangshun / youtube-vimeo-url-parser.js
Last active June 14, 2023 22:27
YouTube Vimeo URL Parser
function parseVideo (url) {
// - Supported YouTube URL formats:
// - http://www.youtube.com/watch?v=My2FRPA3Gf8
// - http://youtu.be/My2FRPA3Gf8
// - https://youtube.googleapis.com/v/My2FRPA3Gf8
// - Supported Vimeo URL formats:
// - http://vimeo.com/25451551
// - http://player.vimeo.com/video/25451551
// - Also supports relative URLs:
// - //player.vimeo.com/video/25451551
@karpathy
karpathy / min-char-rnn.py
Last active May 11, 2024 20:19
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)
@unitycoder
unitycoder / UNITY_MATRIX_IT_MV.shader
Last active October 12, 2023 03:31
UNITY_MATRIX_IT_MV[] Vectors in Shader
UNITY_MATRIX_IT_MV[0].xyz = ???
UNITY_MATRIX_IT_MV[1].xyz = Camera Up
UNITY_MATRIX_IT_MV[2].xyz = Camera Forward
float3 forward = -normalize(UNITY_MATRIX_V._m20_m21_m22);
float3 up = normalize(UNITY_MATRIX_V._m10_m11_m12);
float3 right = normalize(UNITY_MATRIX_V._m00_m01_m02);
float3 cameraUp = unity_CameraInvProjection[1].xyz;
float3 camRight = cross(unity_CameraInvProjection[2].xyz, cameraUp);
@chicoxyzzy
chicoxyzzy / noncoercible.js
Last active March 15, 2021 17:09
Non-coercible objects
function nonCoercible(val) {
if (val == null) {
throw TypeError('nonCoercible shouldn\'t be called with null or undefined');
}
const res = Object(val);
res[Symbol.toPrimitive] = () => {
throw TypeError('Trying to coerce non-coercible object');
}
return res;
};
@GoToLoop
GoToLoop / resizeNN.js
Last active June 6, 2023 18:11 — forked from gncgnc/resizeNN.js
Extends p5.Image to handle nearest neighbor resizing for scaling images w/o blurring.
/**
* Resize the image to a new width and height using nearest neighbor algorithm.
* To make the image scale proportionally,
* use 0 as the value for the wide or high parameters.
* For instance, to make the width of an image 150 pixels,
* and change the height using the same proportion, use resize(150, 0).
* Otherwise same usage as the regular resize().
*
* Note: Disproportionate resizing squashes "pixels" from squares to rectangles.
* This works about 10 times slower than the regular resize.
@Orangestar12
Orangestar12 / ffmpeg.md
Last active February 13, 2024 08:09
quick ffmpeg cheat sheet

If this is too much for you, check out ffmpeg.lav.io

These are a few quick easy ffmpeg command lines that can be used to make oft-used video formats. I use them a lot so I wrote them down in a txt file but I converted it to markdown to upload here and access on all my pcs.

Feel free to use 'em. I've gathered them through superuser posts, wiki trawls, and personal experience.


General notes

@brandedoutcast
brandedoutcast / spam-domains
Last active July 1, 2023 02:28
Spam domains that plague my email
jmails.info
sacustomerdelight.co.in
extrobuzzapp.com
ixigo.info
offer4uhub.com
netecart.com
101coupon.in
freedealcode.in
bankmarket.in
hotoffers.co.in