Skip to content

Instantly share code, notes, and snippets.

@joglr
joglr / INSTALL.ps1
Last active January 26, 2023 12:50
Setup
# Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco feature enable -n=allowGlobalConfirmation
# Browsers
choco upgrade googlechrome firefox
# Development
choco upgrade nvm -y
@echo off
echo Copy this file to any folder and run it to run a local web server in the folderza
start http://localhost:5000 && serve .
async function* events() {
window.addEventListener("mouse move", e => {
yield ([e.pageX, e.pageY])
})
}
for await(events of events) {
}
int[][] result;
float time;
void draw() {
for (int i=0; i<width*height; i++)
for (int a=0; a<3; a++)
result[i][a] = 0;
for (int sa=0; sa<samplesPerFrame; sa++) {
time = map(frameCount-1 + sa*shutterAngle/samplesPerFrame, 0, numFrames, 0, 1);
@joglr
joglr / grain.htm
Created December 20, 2013 20:38
Grain
<html>
<head>
<title>Grain</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<style>
* {
margin: 0; padding: 0;
overflow: hidden;
}
</style>
@joglr
joglr / charcount.htm
Created December 20, 2013 20:34
Character count
<html>
<head>
<title></title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$(function () {
$('textarea').keyup(function() {
var lc = $(this).val().replace(/[^A-Z]/gi, "").length,
s = (lc == 1) ? '':'s';
@joglr
joglr / colorfy.php
Created December 20, 2013 20:27
Minecraft chat message colorfier.
<?php
$str = $_GET['string'];
$str = explode(' ', $str);
$colors = array('a', 'b', 'c', 'd', 'e', '1', '2', '3', '4', '5', '6', '7', '8', '9');
foreach($str as $key => $value) {
$color = $colors[rand(0, count($colors)-1)];
$str[$key] = utf8_decode('§').$color.$value;