Skip to content

Instantly share code, notes, and snippets.

View 4ov's full-sized avatar
🇪🇬

Mohammed 4ov

🇪🇬
View GitHub Profile
@DanB91
DanB91 / README.txt
Last active November 28, 2022 04:57
Playdate Zig starting point
THIS GIST IS OUT OF DATE! Please use my new project template here to get started with Zig on Playdate:
https://github.com/DanB91/Zig-Playdate-Template
The rest of this is preservied for historical reasons:
This is a small snippet of some code to get you started for developing for the Playdate on Zig. This code should be used as a starting point and may not compile without some massaging. This code has only been tested out on macOS and you'll need to modify the addSharedLibrary() portion of build.zig to output a .dll or .so instead of a .dylib, depending on you platform.
This code will help you produce both an executable for the Playdate simulator and also an executable that actually run on the Playdate hardware.
@dominictarr
dominictarr / await.js
Last active May 5, 2024 19:23
wasm zig async example
const fs = require('fs');
const source = fs.readFileSync("./await2.wasm");
const typedArray = new Uint8Array(source);
;(async function () {
var callback, frame
var buffer = Buffer.from("hello world!!!\n")
var result = await WebAssembly.instantiate(typedArray, {
env: {
print: function (ptr, len) {
@wesbos
wesbos / service-worker.js
Created March 24, 2022 18:26
Nuke a service worker from inside a service worker
// put this in a file where your service worker used to live, like yourdomain.com/service-worker.js. You can find out this path in the SW dev tools of your browser
self.addEventListener('install', (e) => {
console.log('[Service Worker] Installing Service Worker ...', e);
self.skipWaiting();
});
self.addEventListener('activate', (e) => {
console.log('[ServiceWorker] Activate');
self.registration
@huytd
huytd / wordle.md
Last active May 16, 2024 20:39
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@iosifnicolae2
iosifnicolae2 / Readme.md
Last active March 12, 2024 19:42
Youtube is Boring

How To Make Youtube Less Boring

Tutorial: https://www.youtube.com/watch?v=hIqMrPTeGTc
Paste the below code in your browser console (F12 > Console):

(()=>{
    markAllVideosAsNotBeingInteresting({
        iterations: 1
    });
})();
@CharlesGodwin
CharlesGodwin / cloudflare.md
Last active April 29, 2024 12:49
I Don't Need Port Forwarding and Don't Care About CGNAT

I Don't Need Port Forwarding and Don't Care About CGNAT

This was rewritten 2022-11-30

This article is for users that want all these features:

  • To connect to home network from anywhere
  • Can connect without any port forwarding; either by choice or internet provider can't or won't provide access
  • No setup or configuration or installation on client machine
  • No enrolment / registration required
@exactlyallan
exactlyallan / cuxfilter-dash.py
Last active July 15, 2021 10:57
RAPIDS cuxfilter double graph dashboard
# Dashboard
# Full example from https://github.com/rapidsai-community/showcase/tree/main/team_contributions/cuxfilter-tutorial
# Data
cux_df = cuxfilter.DataFrame.load_graph((final_df, edges))
# Charts
chart1 = cuxfilter.charts.graph(
edge_source='src', edge_target='dst',
edge_color_palette=['gray', 'black'],
@roalcantara
roalcantara / lua_5_4.md
Created February 28, 2021 02:46
Lua 5.4 - Cheat Sheet

Lua - Beginners Guide

Printing

print("Hello World")

Comments

--this is a comment
@jph00
jph00 / py.md
Last active May 31, 2022 06:16
Organized and hyperlinked index to every module, function, and class in the Python standard library

All of the python 3.9 standard library

For a version without the collapsible details sections (so you can search the whole thing in your browser), click here.

import os
from typing import Optional
from urllib.parse import urlencode
import httpx
from fastapi import Cookie, FastAPI
from fastapi.responses import HTMLResponse, RedirectResponse
# make sure to set these env vars