Skip to content

Instantly share code, notes, and snippets.

View Utopiah's full-sized avatar

Fabien Benetou Utopiah

View GitHub Profile
@bsergean
bsergean / README.md
Last active March 26, 2024 16:16
three.js + headless.gl rendering with texturing

Getting the code

git clone https://gist.github.com/08be90a2f21205062ccc.git

Executing the code

$ npm install # maybe npm start will take care of it but just in case
$ npm start && open out.png

> [email protected] start /Users/bsergean/src/offscreen_sample

@gskema
gskema / color-gradient.js
Last active March 2, 2024 22:14
Generate gradient color from 2 or 3 colors using JavaScript. Example: https://jsfiddle.net/e18g5f3L/
/**
* You may use this function with both 2 or 3 interval colors for your gradient.
* For example, you want to have a gradient between Bootstrap's danger-warning-success colors.
*/
function colorGradient(fadeFraction, rgbColor1, rgbColor2, rgbColor3) {
var color1 = rgbColor1;
var color2 = rgbColor2;
var fade = fadeFraction;
// Do we have 3 colors for the gradient? Need to adjust the params.
@serverwentdown
serverwentdown / extra_tabs.tmpl
Last active June 24, 2024 07:46
A custom template for Gitea to embed pages into tabs with an iframe. Requires the proper X-Frame-Options and Content-Security-Policy on the linked resource. The example below is how I use it for Drone. Install into data/gitea/templates/custom/extra_tabs.tmpl as described on https://docs.gitea.io/en-us/customizing-gitea/#customizing-gitea-pages
<a class="item" href="https://your.domain.here{{.RepoLink}}" data-iframe-tab="builds" title="Builds">
<i class="octicon octicon-gear"></i> <img src="https://your.domain.here/api/badges{{.RepoLink}}/status.svg?ref=refs/heads/master" style="width: auto">
</a>
<script>
document.addEventListener('DOMContentLoaded', () => {
const openFrame = (tab) => {
const name = tab.dataset.iframeTab;
const page = tab.href;

Always Already Programming

Everyone who interacts with computers has in important ways always already been programming them.

Every time you make a folder or rename a file on your computer, the actions you take through moving your mouse and clicking on buttons, translate into text-based commands or scripts which eventually translate into binary.

Why are the common conceptions of programmer and user so divorced from each other? The distinction between programmer and user is reinforced and maintained by a tech industry that benefits from a population rendered computationally passive. If we accept and adopt the role of less agency, we then make it harder for ourselves to come into more agency.

We've unpacked the "user" a little, now let's look at the "programmer." When a programmer is writing javascript, they are using prewritten, packaged functions and variables in order to carry out the actions they want their code to do. In this way, the programmer is also the user. Why is using pre-made scripts seen

@zach-capalbo
zach-capalbo / hubseggbot.js
Created May 16, 2020 14:28
A Headless Mozilla Hubs Bot that drops easter eggs in a room
const ROOM_URL = "https://hub.link/cmPv8xv"
var HEADLESS_BROWSER = true
var puppeteer = require('puppeteer');
var browser
var page
async function launchBrowser () {
browser = await puppeteer.launch({headless: HEADLESS_BROWSER});
@transkatgirl
transkatgirl / encodetwitter.sh
Last active October 29, 2022 11:33
Encode a video for uploading to Twitter using FFMPEG and FDKAAC
#!/bin/bash
# https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/uploading-media/media-best-practices
# - h.264 high profile
# - 60fps or less
# - aac-lc, he-aac not supported
# - 16:9 recommended
# - 512mb maximum
# - shorter than 140s
# - 1:1 pixel aspect ratio
# - yuv 4:2:0
@dprado75
dprado75 / link.php
Created November 10, 2020 01:34
Code snippet to add custom thumbnail to a Mozilla Hubs link (works for Hubs Cloud too)
@Plnda
Plnda / controller.js
Last active August 31, 2024 08:37
Get native gamepad working with SteamDeck
var HID = require('node-hid');
const express = require('express');
// Steam Neptune Controller
var device = new HID.HID("/dev/hidraw3");
var port = 8000
var controller = {
id: "Steam Controller (Neptune)",
index: 0,