Skip to content

Instantly share code, notes, and snippets.

Variables

const shade = 100;
type Shade = 100;

Functions

Обращение к российским IT-специалистам

Коллеги! Армия Путина вторглась в Украину под предлогом «денацификации» и ведёт там грязную войну. У многих из нас есть коллеги из Украины, с которыми можно пообщаться и убедиться в том, что никакого «освобождения» от Путина им не нужно.

Многим из нас сейчас страшно. Но открытое письмо нашей индустрии против этой войны собрало уже более 30 000 подписей. Нас много, и мы уверены, что это не предел.

Правительству тоже страшно: страшно потерять нас. А значит, действия каждого из нас могут помочь прекратить это безумие.

Что делать

@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active July 31, 2025 20:51
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
@prof3ssorSt3v3
prof3ssorSt3v3 / app.mjs
Created September 13, 2021 21:53
Code from video about Closures, Currying, and Partial Application
/**
* Currying vs Partial Application
* Closures
* A function which returns a function that
* can has access to the returned function's scope.
* function example(param){
* let a = 123;
* return function(otherParam){
* //both param and otherParam and a are available here
* }
@jackdomleo7
jackdomleo7 / Useful_global_CSS.css
Last active September 22, 2025 05:17
A set of useful global CSS defaults to add to your site alongside a reset stylesheet (with explanations)
/*! NOTE: These are just recommended default global styles, edit as required */
@import ('Import reset stylesheet here, (I recommend modern-normalize) or even better, import the reset stylesheet in the HTML as the first imported stylesheet');
::selection { /* Optional */
/* It can be really hard to read highlighted text with a text-shadow, it should be removed when selected */
text-shadow: none;
/* NOTE: Using this means the color and background-color are set to transparent for selected text... */
/* So you can customise your styles below */
@LeanSeverino1022
LeanSeverino1022 / evt-delegation.md
Last active August 26, 2021 18:59
event delegation pure js #vanillajs

For example, if you wanted to open a modal when any button with the .modal-open class is clicked, and close modals when an element with the .close class is clicked, you would do this.

document.addEventListener('click', function (event) {

	if (event.target.matches('.modal-open')) {
		// Run your code to open a modal
	}

	if (event.target.matches('.close')) {
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
// colors: https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html
javascript: (function() {
let domStyle = document.getElementById('domStylee');
if (domStyle) {
document.body.removeChild(domStyle);
return;
}
domStyle = document.createElement("style");
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
let domStyle = document.getElementById('domStylee');
if (domStyle) {
document.body.removeChild(domStyle);
return;
}
domStyle = document.createElement("style");
domStyle.setAttribute('id', 'domStylee');
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var domStyle = document.createElement("style");
domStyle.append(
'* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\
* * { background-color: rgba(0,255,0,.2) !important; }\
* * * { background-color: rgba(0,0,255,.2) !important; }\
* * * * { background-color: rgba(255,0,255,.2) !important; }\
* * * * * { background-color: rgba(0,255,255,.2) !important; }\
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active September 1, 2025 09:15
Online Resources For Web Developers (No Downloading)