Skip to content

Instantly share code, notes, and snippets.

View msurguy's full-sized avatar

Maksim Surguy msurguy

View GitHub Profile
@aaroniker
aaroniker / gist:418467cccfb23b9e2da9d17f5d5a54a1
Last active January 15, 2024 21:09
Figma Plugin resize snippets
// Add element to markup
<div id="resize">
<svg viewBox="0 0 20 20">
<path d="...icon..." />
</svg>
</div>
// Styling
#resize {
position: absolute;

Twitter abuses all media file uploads, each type in its own way. If we want to upload a good looking animation loop from some low-color, high-detail generative art, we have to game their system's mechanisms.

  • don't upload a video file, they will re-encode it into absolute 💩

  • create a GIF, which they will auto-convert into a video file 😱

  • The frames of the GIF will be resized to an even-sized width using an extremely naive algorithm. Your GIF should be an even size (1000, 2000,

#!/bin/sh
# ------------------------------------------------------------------------------
# Uses FFmpeg to create an H.264 encoded MPEG-4 movie at 30 fps from
# an image sequence; filesize/quality can be tuned with the second parameter.
#
# ------------------------------------------------------------------------------
# Usage:
# > sh makemovie.sh imageFolder 20
# - imageFolder is a folder containing the images
# - 20 is an optional constant rate factor value,

NFT Statement

Feb 26, 2021

I have decided to release a small set of single-edition NFTs on OpenSea.

I plan to place 100% of direct proceeds from the first sale toward the Bounty for More Eco-Friendly NFTs being developed by Artnome and GitCoin, and 25% of direct proceeds of each of the subsequent 9 artworks in this series toward the same fund.

You can bid/purchase/view the first minted artwork here, and the full series here. At the time of writing, I have only placed 1 artwork on auction, but will place the other 9 in the coming days/weeks.

@mattdesl
mattdesl / sketch.js
Last active April 29, 2022 07:10
h264-mp4-encoder + canvas-sketch = in-browser MP4 generation
// npm canvas-sketch-cli -g
// canvas-sketch sketch.js --open
const canvasSketch = require('canvas-sketch');
const H264 = require('h264-mp4-encoder');
const { lerp } = require("canvas-sketch-util/math");
const settings = {
duration: 4,
dimensions: [1024, 1024],
@zachjharris
zachjharris / TipTapComponent.vue
Created June 29, 2020 12:56
Resizable images using TipTap Editor
<template>
<div class="tiptap-content">
<editor-content :editor="editor" />
</div>
</template>
<script>
import {
Editor,
EditorContent
global.THREE = require("three");
const canvasSketch = require('canvas-sketch');
const Random = require('canvas-sketch-util/random');
const gradientHeight = 512;
const settings = {
dimensions: [ 2048, gradientHeight * 2 ]
};
@techninja
techninja / todo.md
Last active July 5, 2020 18:24
Remaining TODOs for CNCServer on the path to v3

Current TODOs for CNCServer on the path to v3

Render pipeline

  • Make a hash data attached to each render target within the render grouping for the item.
  • With hash against each settings item on the final, (plus width/height), should prevent re-renders when needed
  • Allow moving of stage item (bounds change, but w/h don't) to move rendered group.
  • Raster: Get resolution size down working for big images (calculate DPI from bounds scale).
  • Pass cncserver specific tmp dir over as part of filler/vectorizer utils so we don't need that in implementors.
@andreyryabtsev
andreyryabtsev / backmatting.ipynb
Last active January 16, 2024 11:59
BackMatting.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js webgl - exporter - obj</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
.floating {