Skip to content

Instantly share code, notes, and snippets.

@nimone
nimone / Sidebar.jsx
Created June 29, 2023 09:33
Retractable Sidebar Component purely in ReactJS and TailwindCSS
import { MoreVertical, ChevronLast, ChevronFirst } from "lucide-react"
import { useContext, createContext, useState } from "react"
const SidebarContext = createContext()
export default function Sidebar({ children }) {
const [expanded, setExpanded] = useState(true)
return (
<aside className="h-screen">
@Geoff-Ford
Geoff-Ford / master-javascript-interview.md
Last active March 22, 2024 07:14
Eric Elliott's Master the JavaScript Interview Series
@codediodeio
codediodeio / longest-substring.js
Created September 4, 2017 23:13
Longest Substring JavaScript - LeetCode Solution
// Given a string, find the length of the longest substring without repeating characters.
// Examples:
// Given "abcabcbb", the answer is "abc", which the length is 3.
// Given "bbbbb", the answer is "b", with the length of 1.
// Given "pwwkew", the answer is "wke", with the length of 3. Note that the answer must be a substring, "pwke" is a subsequence and not a substring.
@pcan
pcan / README.md
Last active April 17, 2024 01:45
Node.js plain TLS Client & Server, 2-way Cert Auth

Node.js TLS plain TLS sockets

This guide shows how to set up a bidirectional client/server authentication for plain TLS sockets.

Newer versions of openssl are stricter about certificate purposes. Use extensions accordingly.

Prepare certificates

Generate a Certificate Authority:

@primaryobjects
primaryobjects / substring.js
Last active March 8, 2023 23:39
Longest Substring Without Repeating Characters in javascript.
/**
* @param {string} s
* @return {number}
*/
var lengthOfLongestSubstring = function(s) {
var max = 0;
var str = '';
var i = 0;
var cache = [];
@mdsaleemj
mdsaleemj / Software-Development-Principles.md
Last active February 25, 2017 17:55
Software Development Priniciples

The purpose of this gist is to know more about the software developing principles in general. This intention is to explore and know more about software development from industry leaders like Martin Flowers, Robrt Martin(aka UncleBob ) and many .

In addition to that , learning and practising programming and desing skill with emphasis on necessary programming styles like OOP and FP needs to be encouraged.
This guide is started as rough draft and will serve to contain information about resources , leaders to follow, topics under software development.

##Software Development

# remap C-b to C-a
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# reload the conf file on the fly
bind r source-file ~/.tmux.conf
# who knows what this does, but I can now scroll in a tmux pane
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
@Mirabis
Mirabis / docker-compose.yml
Created April 24, 2016 10:55
Docker-Compose Example
version: "2"
services:
openvpn:
image: dperson/openvpn-client:latest
command: -f
restart: always
dns: 10.0.0.2
cap_add:
- NET_ADMIN
devices:
@subfuzion
subfuzion / curl.md
Last active April 17, 2024 04:24
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@paulirish
paulirish / what-forces-layout.md
Last active April 19, 2024 06:03
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent