Skip to content

Instantly share code, notes, and snippets.

View 4ov's full-sized avatar
🇪🇬

Mohammed 4ov

🇪🇬
View GitHub Profile
@4ov
4ov / fix_res.sh
Created September 23, 2022 22:11
xrandr -s 1920x1080 -r 60
@4ov
4ov / style.css
Created August 21, 2022 22:38
web things
/* css aspect-ratio */
.width-same-as-height{
aspect-ratio: 1 / 1;
height: 100%;
}
import { serve } from "https://deno.land/std/http/server.ts";
serve(req => new Response("Hello World\n"),{
port: 3000
});
@4ov
4ov / deno.ts
Last active October 12, 2021 14:24
deno deploy env test
import { h, json, jsx, serve } from "https://deno.land/x/sift/mod.ts";
serve({
"/set": () => {
localStorage.x = `${Math.random()}`
return new Response("hola")
},
@4ov
4ov / ftp.v
Created September 12, 2021 13:22
import net.ftp
import os
const(
backup_dir = "backup"
)
fn main(){
println("Connecting...")
mut conn := ftp.new()
@4ov
4ov / linux.md
Last active June 23, 2021 15:18
every single trick i know

control media from terminal

tested on ubuntu 20.04 ref

xdotool key XF86AudioPlay
@4ov
4ov / lodash_settings.js
Created June 13, 2021 15:53
my lodash settings for templates
_.templateSettings = {
evaluate: /\~([^~]*?)\~/, ///{{--([\s\S]+?)}}/g,
interpolate: /{{([\s\S]+?)}}/g,
escape: /{{-([\s\S]+?)}}/g
};
// ~ eval ~
// {{ interpolate }}
// {{- escape }}
@4ov
4ov / main.js
Created June 6, 2021 17:57
example of deno-fetcher usage
import Fetcher from 'https://raw.githubusercontent.com/4ov/deno-fetcher/main/mod.ts'
const app = new Fetcher();
app.get('/', (event)=>{
event.respondWith(new Response('hola'))
})
addEventListener('fetch', app.handle.bind(app))

Keybase proof

I hereby claim:

  • I am 4ov on github.
  • I am 4ov (https://keybase.io/4ov) on keybase.
  • I have a public key ASCHQARzNtK9RXRU_8c2jYvM0n6Iqpowbuert7h1DiFJYAo

To claim this, I am signing this object:

import { serve } from "https://deno.land/std@0.79.0/http/server.ts";
const s = serve({ port: 8000 });
for await (const req of s) {
req.respond({ body: "4" });
}