Skip to content

Instantly share code, notes, and snippets.

vcompress

Include this in your bashrc / bash_profile:

function vcompress() {
    local base="$(basename "$1" .mp4)"
    ffmpeg \
      -i "$1" \
 -vf 'scale=if(gte(iw\,ih)\,min(1580\,iw)\,-2):if(lt(iw\,ih)\,min(1580\,ih)\,-2)' \
const $ = selector => document.querySelector(selector)
const $$ = selector => document.querySelectorAll(selector)
// $ returns a node (or null)
$('.nav').classList.add('open')
// $$ returns a NodeList (which is empty if no matching elements are found)
$$('ul > li > a').forEach($node => $node.style.background = 'red')
@manderly
manderly / parsely.js
Created December 17, 2018 22:09
node js project that builds static data files for my Godot project
/* Parsely v.0.1
Developed for Guild Leader project (December 2018)
To use: place .json files in parsely/names, parsely/staticData, parsely/timedNodeData, etc.
In Terminal:
node parsely.js
Exported .gd files are placed directly in gameData folder.
@liborvanek
liborvanek / transition.js
Last active October 12, 2024 16:17
Page transition mixin for Nuxt.js with GreenSock GSAP
import { TimelineMax, TweenMax, Power2, Back } from 'gsap'
let curtainsOpenTimeline = () => {
return new TimelineMax()
.set('.curtains', { transformOrigin: '0%' })
.fromTo('.curtains', 0.6, { scaleX: 0 }, { scaleX: 1, ease: Power2.easeInOut })
.fromTo('.curtains-logo', 0.3, { x: '-100%', autoAlpha: 0 }, { x: '-50%', autoAlpha: 1, ease: Power2.easeInOut }, '-=0.45')
}
let curtainsCloseTimeline = () => {
@EIREXE
EIREXE / Godot Minimap.md
Last active April 17, 2025 11:48
Automatic minimap generation in godot

Building an automated map/minimap system in Godot

Why?

Our game, ERO-ONE needed a minimap system, it being an open world game made this a necessity, otherwise the player wouldn't really know where he's going.

Of course making a proper minimap is hard, we told ourselves that our game didn't really need it because it's not as big as the open world powerhouse that is Grand Theft Auto, but the real reasons are...

@willnationsdev
willnationsdev / sample.jns
Last active February 13, 2018 22:46
JourneyScript concept
# JourneyScript is a narrative scripting language that allows us to
# control the content, context, and flow of dialogue. It is designed
# to mimic as closely as possible the format of a screenplay, but
# it also enables writers to define custom logic and behavior.
# Content is broken up into dialogue segments. The Journey system
# simply provides an "advance" method to programmers which shifts
# the content into the next segment.
# This is a single-line comment.
@noygal
noygal / Windows Subsystem for Linux version 1 and 2 (WSL) - node install guide.md
Last active October 16, 2024 01:06
Installing node via windows subsystem for linux

Windows 10 version 2004 - Installing Node.js on Windows Subsystem for Linux (WSL/WSL2)

UPDATE (Fall 2020): This gist is an updated version to the Windows 10 Fall Creators Update - Installing Node.js on Windows Subsystem for Linux (WSL) guide, I usually just keep here notes, configuration or short guides for personal use, it was nice to know it also helps other ppl, I hope this one too.

Windows updated windows subsystem for linux to version 2, as the F.A.Q stated you can still use WSL version 1 side by side with version 2. I'm not sure about existing WSL machines surviving the upgrade process, but as always backup and 🤞. NOTE: WSL version 1 is not replace/deprecated, and there ar

@willnationsdev
willnationsdev / RigidbodyController3D.gd
Last active February 27, 2024 20:03
A Basic Controller for a 3D Rigidbody in Godot 3.0
# ---
# Note: I honestly can't remember where this gist came from.
# This sounds like something I would've uploaded from sample code people shared on Reddit while asking questions.
# So, as far as my part in sharing this code, I would consider it to be MIT licensed.
# If someone on Reddit suddenly pops up saying I'm not crediting them, then I'll gladly add the credit.
# ---
# A Rigidbody Controller for basic 3D movement
extends RigidBody
@jescalan
jescalan / index.md
Last active May 8, 2017 18:25
Spike v1 Migration Guide

Spike v1 Migration Guide

Spike v1 represents a significant change, mostly because it includes an update from webpack v1 to webpack v2 behind the scenes. The aim of this piece is to guide you through the process of migration from one version to the next, and explain a bit of the rationale behind these changes.

App.js Updates

The bulk of the migration work lies in the app.js file. Webpack drastically changed its configuration in a very breaking manner between v1 and v2, so spike was forced to do the same, since spike is an extension of webpack.

Webpack Config Changes

@pjamar
pjamar / sniproxy.md
Created January 7, 2016 18:38
SNI Proxy Tutorial

SNI Proxy for sharing an SSL port 443 with Sandstorm

Make Sandstorm and other web server coexist in the same port while keeping HTTPS encryption.

Introduction

The purpose of this tutorial is to set up SNI Proxy so it’s possible to use Sandstorm verified SSL encryption while coexisting with another web server that also uses SSL.

The main reason is to allow other users to connect with your Sandstorm instance in the standard HTTPS port (443) and keep using that port also for any other web apps.