Fully responsive and animated settings modal - CSS-only, no Javascript. Got a bit of a design-block so it's a little late!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Custom Error page | |
by Oscar | |
*/ | |
<?php | |
if (!function_exists('http_response_code_title')) | |
{ | |
function http_response_code_title($code = 403) | |
{ | |
$title = 'Forbidden'; |
Moved to git repository: https://github.com/denji/golang-tls
# Key considerations for algorithm "RSA" β₯ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" β₯ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const app = require('express')() | |
const fetch = require('node-fetch') | |
const API_KEY = process.env.API_KEY | |
app.get('/posts', async (req, res) => { | |
const getPosts = () => fetch(`/api/key=${API_KEY}`) | |
const processPosts = async () => { | |
const posts = await getPosts() | |
const postsJSON = await posts.json() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const app = express() | |
const log = console.log | |
const myLogger = (req, res, next) => { | |
res.on('finish', function() { | |
log(`${this.statusCode} ${req.method} ${req.path} - ${req.headers['cf-connecting-ip']} `) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const addJs = url => { | |
let jsScript = document.createElement('script') | |
jsScript.setAttribute('src', url) | |
document.head.appendChild(jsScript) | |
} | |
const addJsModule = url => { | |
let jsScript = document.createElement('script') | |
jsScript.setAttribute('src', url) | |
jsScript.setAttribute('type', 'module') | |
document.head.appendChild(jsScript) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# fixes the weird green background for dirs | |
dircolors -p > ~/.dircolors | |
# STICKY_OTHER_WRITABLE 30;42 | |
# OTHER_WRITABLE 34;42 | |
sed -i -e 's/STICKY_OTHER_WRITABLE 30;42/STICKY_OTHER_WRITABLE 01;34/g' ~/.dircolors | |
sed -i -e 's/OTHER_WRITABLE 34;42/OTHER_WRITABLE 01;34/g' ~/.dircolors | |
bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const el = document.querySelector('.el') | |
let options = { | |
root: null, // avoiding 'root' or setting it to 'null' sets it to default value: viewport | |
rootMargin: '0px', | |
threshold: 0.5 | |
} | |
let observer = new IntersectionObserver(([entry]) => { | |
if(entry.isIntersecting) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const initialState = { | |
counter: 0 | |
} | |
const counterReducer= (state, event) => { | |
if (event.type === 'INC') { | |
return { | |
...state, | |
counter: state.counter +1 | |
} |
OlderNewer