Skip to content

Instantly share code, notes, and snippets.

View aleksandar-b's full-sized avatar
:electron:
Focusing

Alex Brajkovic aleksandar-b

:electron:
Focusing
View GitHub Profile
@branneman
branneman / fp-lenses.js
Last active May 17, 2023 00:56
JavaScript: Lenses (Functional Programming)
// FP Lenses
const lens = get => set => ({ get, set });
const view = lens => obj => lens.get(obj);
const set = lens => val => obj => lens.set(val)(obj);
const over = lens => fn => obj => set(lens)(fn(view(lens)(obj)))(obj);
const lensProp = key => lens(prop(key))(assoc(key));
(function(node, body){
node.style.display = 'inline-block';
node.style.position = 'absolute';
node.style.height = '0';
node.style.overflow = 'scroll';
body.appendChild(node);
body.style.setProperty('--scrollbar', node.offsetWidth + 'px');
body.removeChild(node);
})(document.createElement('scrollbartester'), document.body);
public interface IAPIProvider
{
void SearchHotels();
void GetHotelDetails();
void GetRoomDetails();
void GetCancellationPolicies();
void GetExtraGuestChargeDetails();
void BlockRoom();
void BookRoom();
void GetBookingDetails();
@akbstone
akbstone / .block
Last active February 6, 2018 14:37 — forked from mbostock/.block
Closest Point on Path
license: gpl-3.0
@ryanbru0803
ryanbru0803 / squash-and-stretch.js
Last active February 26, 2020 08:46
The squash and stretch expression should make your animation a bit more alive by adding a proportional squash and stretch scale to your shapes or images.
maxDev = 13; // max deviation in pixels
spd = 30; //speed of oscillation
decay = 1.0; //how fast it slows down
t = time - inPoint;
x = scale[0] + maxDev*Math.sin(spd*t)/Math.exp(decay*t);
y = scale[0]*scale[1]/x;
[x,y]
@kawanet
kawanet / material-colors.json
Last active February 19, 2026 00:36
Material Design Style Color Palette as JSON
{
"red": {
"50": "#ffebee",
"100": "#ffcdd2",
"200": "#ef9a9a",
"300": "#e57373",
"400": "#ef5350",
"500": "#f44336",
"600": "#e53935",
"700": "#d32f2f",
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active March 7, 2026 11:26
Vanilla JavaScript Quick Reference / Cheatsheet
@jfmengels
jfmengels / lodash-fp-documentation.md
Last active January 15, 2025 00:34
Generated docs for Lodash/fp. Help make them better at https://github.com/jfmengels/lodash-fp-docs
@bendc
bendc / isNumber.js
Last active October 26, 2015 08:29
isNumber() checks if its argument represents a numeric value
const isNumber = x =>
!Number.isNaN(parseInt(x)) && Number.isInteger(Math.trunc(x));
@royshouvik
royshouvik / Full Stack JavaScript.md
Last active February 24, 2026 02:11
Learn Full Stack JavaScript Web Development for FREE using resources like YouTube, Udacity and NodeSchool