Skip to content

Instantly share code, notes, and snippets.

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 28, 2024 14:27
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@noghartt
noghartt / cc.md
Last active April 28, 2024 14:26
Resources to learn more about Computer Science and related stuffs
@Resinchem
Resinchem / virtual_switch_examples.yaml
Last active April 28, 2024 14:26
Example Home Assistant Virtual Switch Examples as shown in YouTube Video
# ==========================================================
# DASHBOARD YAML
# All examples will need to be edited to use your entity
# names and particular installation.
#
# This dashboard example includes a toggle with conditional
# cards to switch between custom button card and standard
# entities display as shown in the video:
# https://youtu.be/mj2CIKqrQlc
# ==========================================================
@paulirish
paulirish / what-forces-layout.md
Last active April 28, 2024 14:20
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@PJUllrich
PJUllrich / big-o.md
Last active April 28, 2024 14:19
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for <= 32 elements, O(log n) for > 32 elements [2]
Deletion O(n) for <= 32 elements, O(log n) for > 32 elements
@sbose78
sbose78 / views.py
Created September 9, 2012 20:02
Uploading files in Django using pymongo
import os
import gridfs
from django.http import HttpResponse
from pymongo.connection import Connection
from django.shortcuts import get_object_or_404, render_to_response
from django.http import HttpResponseRedirect, HttpResponse
from django.template import Context, RequestContext,loader
from bson.object import ObjectId
#uploading form including image/file
@DraTeots
DraTeots / ComPort over Network.md
Last active April 28, 2024 14:16
ComPort over Network
@KalleMacD
KalleMacD / TwineiOS
Last active April 28, 2024 14:14
How to make a Twine game into an iOS web-app
//This quick guide will show you how add an optional web-app (iOS) view to your Twine game!
//First you'll need to open up your Twine (.tws) file.
1. Add a new passage to your story and name it "script"
2. Enter the tags section and add the word "script"
3. Now, in the main body, add the code:
document.addEventListener('touchmove', function(e) {
e.preventDefault();
}, false);
@MM1212
MM1212 / InheritClasses.ts
Created December 20, 2023 19:47
Inherit any number of classes with some type-safety
type GrabConstructorParameters<T> = {
[K in keyof T]: T[K] extends new (...args: infer P) => any ? P : never;
}
// https://stackoverflow.com/a/50375286
type UnionToIntersection<U> =
(U extends any ? (x: U)=>void : never) extends ((x: infer I)=>void) ? I : never
type JoinConstructors<T extends (new (...args:any[]) => any)[]> =
new (...args: GrabConstructorParameters<T>) => UnionToIntersection<InstanceType<T[number]>>
@thomasheller
thomasheller / INSTALL.md
Last active April 28, 2024 14:08
Install Arch Linux in VirtualBox VM