Skip to content

Instantly share code, notes, and snippets.

View AlexDev404's full-sized avatar
👾
Ruby2D!

Immanuel Daviel A. Garcia AlexDev404

👾
Ruby2D!
View GitHub Profile
@AndrewLester
AndrewLester / pages.yml
Last active December 28, 2024 05:13
Github Actions Workflow Deploy SvelteKit Github Pages
# Updated from SvelteKit docs. See https://kit.svelte.dev/docs/adapter-static#github-pages for more information
name: Deploy to GitHub Pages
on:
push:
branches: 'main'
jobs:
build_site:
@boly38
boly38 / Listing.js
Created March 23, 2022 12:18
Mongoose expireAt example
import mongoose from 'mongoose';
const { Schema } = mongoose;
const Listing = new Schema({
"listing_id": { type: Number, index: true, unique: true },
"title": String,
"expireAt": { type: Date, expires: 10 } // <========== TTL index here
});
export { Listing };
@JohannesMP
JohannesMP / EnableDiscordDevExperiments.md
Last active May 3, 2025 09:15 — forked from ExordiumX/betaenabler.js
Enabling Discord Dev Experiments on Discord for Windows (2022-02)

Enable Dev Experiments in Discord for Windows

image

This guide shows how to enable dev mode for the Discord desktop application running on Windows (as of February 2022).

This can be used to view beta experiments to try features currently in development that are included but hidden by default in Discord release builds.


@fronterior
fronterior / electron-prevent-zorder-change.js
Last active January 26, 2022 01:05
WM_WINDOWPOSCHANGING Message Handler for Electron Application, which is always fixed on the floor.
// Node.js & Electron reference : https://stackoverflow.com/a/58473299
// C++ reference : https://stackoverflow.com/a/65052538
// Environment:
// - Windows 10
// - Nodejs v14.17.6
// Dependencies:
// - [email protected]
// - [email protected]
// - [email protected]
// - [email protected]
var maxBackoff = 5000;
var expBackoffLogs = [];
function tryWithTimeout(testFunction, argument, timeout) {
return new Promise((resolve) => {
setTimeout(() => {
resolve();
}, timeout);
}).then(() => {
expBackoffLogs.push(
@derekmc
derekmc / softlock.js
Last active September 4, 2023 16:19
Simple example of a "softlock" concurrent database
let softlock = require('softlock');
softlock.backoffAlgorithm('linear');
softlock.maxResets(4);
let query = softlock.query();
// Softlock is a concurrent database that emulates a locking mechanism using versioned keys.
// If a 'locked' key has been changed since the transaction started, then the transaction
// is rejected and the logic retried
query.lock(['a','b','c']); // these keys are locked, but their values are not retrieved.
@HoussemNasri
HoussemNasri / BalsamiqForever.py
Last active May 7, 2025 07:35
Extend your trial period for Balsamiq Wireframes on Windows and macOS Forever!
import json
import os
import time
import webbrowser
import sys
import re
def handleWindows(extra_seconds):
print("OS : Windows")

The Freenode resignation FAQ, or: "what the fuck is going on?"

IMPORTANT NOTE:

It's come to my attention that some people have been spamming issue trackers with a link to this gist. While it's a good idea to inform people of the situation in principle, please do not do this. By all means spread the word in the communities that you are a part of, after verifying that they are not aware yet, but unsolicited spam is not helpful. It will just frustrate people.

Update 3 (May 24, 2021)

A number of things have happened since the last update.

@agichim
agichim / flash-custom-rom-motog8power.md
Last active March 23, 2025 22:33
Full guide to flash Moto G8 Power (sofiar)
id title desc updated created
3UT7YPV6Qnr2UL6H6roQ0
Motog8power
1682709194077
1629568034286

Moto G8 Power guide to flash and install a custom ROM

/* global YT */
export default (function() {
function init(id, el, callback, state) {
// Set function global so the YouTube API can connect with it.
window.onYouTubeIframeAPIReady = () => {
let player = new YT.Player(el, { // eslint-disable-line no-unused-vars
videoId: id,
width: '100%',