Skip to content

Instantly share code, notes, and snippets.

View shikelong's full-sized avatar
🏠
Working from home

shikelong shikelong

🏠
Working from home
View GitHub Profile
@shikelong
shikelong / .zshrc
Last active April 11, 2024 01:26
🐳 My MacOS Development Env Setup
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
@ruizb
ruizb / README.md
Last active September 4, 2024 06:17
A glossary of TypeScript.

A glossary of TypeScript

Motivation

Once upon a time, there was a developer that had an issue using the TypeScript language. He wanted to share his issue with the community to get help, but he didn't know how to properly write the title that would best describe his problem. He struggled to find the appropriate words as he didn't know how to name "this behavior" or "that kind of type mechanism".

This story encouraged me to start writing a glossary of TypeScript. Hopefully it will help you if you have to look for an issue, write an issue, or communicate with other TypeScript developers.

Disclaimer: it was me, I was the developer that struggled. I still struggle though, but this means I still have things to learn, which is great!

@andywer
andywer / _readme.md
Last active August 12, 2024 07:58
React - Functional error boundaries

React - Functional error boundaries

Thanks to React hooks you have now happily turned all your classes into functional components.

Wait, all your components? Not quite. There is one thing that can still only be implemented using classes: Error boundaries.

There is just no functional equivalent for componentDidCatch and deriveStateFromError yet.

Proposed solution

@jtanguy
jtanguy / dependency-graph-plugin.js
Created June 6, 2018 19:20
Webpack plugin to generate the dependency graph
const path = require('path');
class DependencyGraphPlugin {
apply(compiler) {
compiler.hooks.emit.tap("DependencyGraphPlugin", (compilation) => {
let deps = [];
compilation.modules.forEach(m => {
// console.log(m)
const file = path.relative('', m.resource)
@VesperDev
VesperDev / RouterApp.js
Last active July 14, 2024 11:50
Sider menu + ant-design + react-router-dom
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Layout, Menu, Icon } from 'antd';
import Dashboard from './containers/Dashboard/Dashboard';
import Meseros from './containers/Meseros/Meseros';
const { Header, Content, Footer, Sider } = Layout;
const SubMenu = Menu.SubMenu;
@faressoft
faressoft / dom_performance_reflow_repaint.md
Last active September 11, 2024 15:18
DOM Performance (Reflow & Repaint) (Summary)

DOM Performance

Rendering

  • How the browser renders the document
    • Receives the data (bytes) from the server.
    • Parses and converts into tokens (<, TagName, Attribute, AttributeValue, >).
    • Turns tokens into nodes.
    • Turns nodes into the DOM tree.
  • Builds CSSOM tree from the css rules.
@vman
vman / CSOM.MFA.cs
Last active December 17, 2021 17:41
SharePoint Online: Using CSOM with an account configured with Multi-factor Authentication (MFA)
using Microsoft.SharePoint.Client;
using OfficeDevPnP.Core;
using System;
namespace CSOMDemo
{
class Program
{
static void Main(string[] args)
{
@elchele
elchele / cw7.cs
Last active November 23, 2020 06:20
Base C# class for interacting with Sugar 7 REST v10 API
/* SugarCRM v7 REST API Wrapper
*
* Date: May 13, 2014
*
* Author: Angel Magaña
*
* Contact: cheleguanaco[at]cheleguanaco.com
* cheleguanaco.com
*
*
@colin-han
colin-han / Functional Programming练习题.md
Last active May 10, 2022 06:32
Functional Programming练习题

一、理解函数式编程

1. 有一个Web服务,为你提供了如下的数据结构:

难度:★

var data = [
  {
    name: "Jamestown",
    population: 2047,
    temperatures: [-34, 67, 101, 87]

},