Skip to content

Instantly share code, notes, and snippets.

@ngtrphuong
ngtrphuong / ABC.md
Created April 16, 2024 03:40 — forked from jdnichollsc/ABC.md
The Job Interview Guide

The Job Interview Guide 💼

And English is a Work in Progress ⌛

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 26, 2024 22:19
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser! If you absolutely need to use browser instead of desktop app, use an extension to add the string Electron/ anywhere in your user-agent.

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
"source ~/.vimrc
" Find more examples here: https://jb.gg/share-ideavimrc
let mapleader=" "
" Don't use Ex mode, use Q for formatting.
map Q gq
set number relativenumber
set scrolloff=5
@grenade
grenade / nvidia-driver-reinstall.sh
Last active April 26, 2024 22:12
reinstall nvidia driver from rpm-fusion after a fedora upgrade
#!/bin/bash
# usage:
# curl -sL https://gist.github.com/grenade/8844d472bc1dcec48d37291b0b7b7220/raw/nvidia-driver-reinstall.sh?$(uuidgen) | bash
# uninstall all nvidia packages
sudo dnf erase '*nvidia*'
# disable the nvidia driver that doesn't come from rpm-fusion
# https://rpmfusion.org/Howto/CUDA#Which_driver_Package
function aWaitForSuccess({ name, timeout, validator }) {
let def = promise.defer();
function wait(validator) {
validator().then((success) => {
if(success) {
ok(true, "Validator function " + name + " returned true");
def.resolve();
} else {
setTimeout(() => wait(validator), timeout);
@freaktechnik
freaktechnik / elementary-apps.md
Last active April 26, 2024 22:11
Nice elementary packages I like to add
"use strict";
// Require some stuff
const { myMethod } = require("my-method");
// Init code
myMethod("initializing");
...
// Cleaning up
const run = async (allowRefresh) => {
const response = await this.runRequest(methid, url, data);
if(this.requireRefresh(response) && allowRefresh)
return 'refresh';
else if(response.error)
throw response;
else
return response;
};
const panel = new Panel({...});
const runLoop = (text, i = 0) => {
// do something
self.port.once("updated-something", runLoop.bind(null, text, i + 1));
self.port.emit("update-something", data);
};
panel.port.on("text-changed", (text) => {
runLoop(text);