Skip to content

Instantly share code, notes, and snippets.

View omar2205's full-sized avatar
πŸ•

omar2205

πŸ•
View GitHub Profile
print("HI")
@omar2205
omar2205 / index.md
Last active September 3, 2020 08:39
Simple CSS

Simple CSS Boilerplate

Β© oskr.nl

@omar2205
omar2205 / setup_node.sh
Created October 6, 2020 09:18
Quick nodejs install script
#!/usr/bin/bash
# Quick script to install node (v14)
# - oskr
echo "\tWelcome to Node Install script\n\n"
set -o xtrace
wget "https://deb.nodesource.com/setup_14.x" -O setup_14x.sh
chmod +x setup_14x.sh
@omar2205
omar2205 / README.md
Created October 20, 2020 04:21
css backdrop blur with sharp edges

css

background-color: rgba(0,0,0,.8);
backdrop-filter: url(#sharpBlur) saturate(180%);

html

<svg class="hideSvgSoThatItSupportsFirefox">
  <filter id="sharpBlur">
 
@omar2205
omar2205 / fileio.bat
Created October 27, 2020 01:26
Windows 10 Upload with Fileio
REM move this file to "C:\Windows\System32"
curl -F "file=@%1" file.io
pause
@omar2205
omar2205 / 06.png
Last active November 2, 2020 03:27 — forked from mfd/06.png
Gilroy font
06.png
@omar2205
omar2205 / package.json
Created December 24, 2020 00:29
Vercel express server
{
"name": "something",
"version": "2.2.0",
"description": "",
"main": "index.js",
"dependencies": {
"ejs": "^3.1.5",
"express": "^4.17.1",
"helmet": "^4.2.0"
},
@omar2205
omar2205 / .screenrc
Last active December 27, 2020 08:48
gnu screen w/ battery
# Turn off that annoying start up message
startup_message off
# Turn the even more annoying whole-screen-flash-on-tab-complete "feature"
vbell off
# Window list at the bottom. hostname, centered tabs and redmarked active windows:
#shelltitle '$ |'
backtick 1 1 1 $HOME/bin/battery
@omar2205
omar2205 / app.js
Last active April 20, 2021 00:58
Shrink Logo on scroll
logo = document.querySelector('#logo')
document.addEventListener('scroll', e => {
let yo = parseInt(pageYOffset)
let maxHeight = 150
if(yo <= maxHeight) {
let per = (yo / maxHeight) * 100
// console.log(yo, ' ----> ', per, '// ', Math.abs(per - 100))
logo.style.scale = `clamp(0.75, ${Math.abs(per - 100) * 0.01}, 1)`
}
})
@omar2205
omar2205 / index.js
Created May 15, 2021 04:21
handle 404 in express js
const express = require('express')
const app = express()
// ~ all routes
// last route
app.use((req, res) => {
res.status(404).send('Custom 404 handler')
})