Skip to content

Instantly share code, notes, and snippets.

View neg4n's full-sized avatar
📖
Never stop learning

Igor Klepacki neg4n

📖
Never stop learning
View GitHub Profile
@GregBrimble
GregBrimble / image-test.tsx
Created September 27, 2021 09:41
Example of Cloudflare Images on Next.js (WIP)
import Image, { ImageLoader } from "next/image";
type Width = [string, number];
const widths = {
sm: 640,
md: 768,
lg: 1024,
xl: 1280,
};
@muthhukumar
muthhukumar / chakra-ui-editable-textarea.tsx
Last active July 23, 2021 14:31
Chakra-ui editable textarea
import * as React from 'react'
import {
chakra,
forwardRef,
omitThemingProps,
StylesProvider,
SystemStyleObject,
ThemingProps,
useMultiStyleConfig,
useStyles,
@sindresorhus
sindresorhus / esm-package.md
Last active June 1, 2024 19:35
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@FergusInLondon
FergusInLondon / filesnooper.c
Last active September 24, 2021 16:20
LD_PRELOAD Code Injection and Hooking
/* filesnooper.c - Fergus In London <fergus@fergus.london>
*
* Similar to snoopy.c, wrote to scratch an itch and demonstrate how LD_PRELOAD
* can be used for injecting code and/or hooking/wrapping around function calls.
*
* This is actually a good example, because if you try and use it with different
* ways of writing files, you'll see that to actually do this effectively you'd
* need to examine the target binary with strace, and potentially implement
* signatures from other libraries. (i.e a binary calling fprintf() may not be
* be effected by this.)
@KodrAus
KodrAus / Profile Rust on Linux.md
Last active November 14, 2023 17:19
Profiling Rust Applications

Profiling performance

Using perf:

$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg

NOTE: See @GabrielMajeri's comments below about the -g option.

@Birdie0
Birdie0 / ifttt-webhooks-extended-guide.md
Last active March 6, 2024 13:38
How to use Discord Webhooks

⚠️ This gist is no longer updated! For maintained, improved and even more extended guide click here.


How to use Discord Webhook

It's a JSON

First, learn JSON. It's not programming language, not even close. Just follow syntax rules and you will be fine.

@IssacTran
IssacTran / perfectelementary.bash
Created June 16, 2016 18:13
HowTo Install the perfect Elementary-OS
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
@btfak
btfak / useHexo.md
Created May 26, 2016 09:41
How to use Hexo and deploy to GitHub Pages