Skip to content

Instantly share code, notes, and snippets.

@madan712
madan712 / dragable_swipeable.js
Last active April 28, 2024 16:13
React native draggable and swipeable list
import DraggableFlatList, { ScaleDecorator } from 'react-native-draggable-flatlist'
import SwipeableItem from 'react-native-swipeable-item'
.
.
.
const itemRefs = React.useRef(new Map())
<DraggableFlatList
activationDistance={15}
data={getCategoriesFromTaskList()}
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 28, 2024 16:11
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@skippednote
skippednote / setup-tor.md
Last active April 28, 2024 16:09
Setup Tor on macOS

Setup One: Buy a Mac if you don't have one.

Setup Two: Install Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Setup Three:

@diegoliv
diegoliv / webflow.html
Last active April 28, 2024 16:09
Lenis + Webflow (with anchor links workaround)
<script src="https://cdn.jsdelivr.net/gh/studio-freight/lenis@v0.2.26/bundled/lenis.js"></script>
<script>
if (!document.querySelector("html").classList.contains('w-editor')){
const lenis = new Lenis({
duration: 1.2,
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), // https://www.desmos.com/calculator/brs54l4xou
direction: 'vertical', // vertical, horizontal
gestureDirection: 'vertical', // vertical, horizontal, both
smooth: true,
@janispritzkau
janispritzkau / sungrow_sh10rt_modbus.yaml
Created August 9, 2022 09:48
Modbus Registers for Sungrow SH10RT Hybrid Inverter
input_registers:
- name: protocol_number
data_type: uint32
address: 4950
- name: protocol_version
data_type: uint32
address: 4952
- name: arm_software_version
data_type: string
address: 4954
/*
* This script fetches all color styles from a Figma team/document.
*
* Dependencies:
*
* - node-fetch
*
* Due to a limitation in the Figma /styles endpoint, we need to use a
* document for actually using the colors in a color grid 🙄That's why
* we're both fetching from /styles and /files below.
@vegard
vegard / kernel-dev.md
Last active April 28, 2024 16:02
Getting started with Linux kernel development

Getting started with Linux kernel development

Prerequisites

The Linux kernel is written in C, so you should have at least a basic understanding of C before diving into kernel work. You don't need expert level C knowledge, since you can always pick some things up underway, but it certainly helps to know the language and to have written some userspace C programs already.

It will also help to be a Linux user. If you have never used Linux before, it's probably a good idea to download a distro and get comfortable with it before you start doing kernel work.

Lastly, knowing git is not actually required, but can really help you (since you can dig through changelogs and search for information you'll need). At a minimum you should probably be able to clone the git repository to a local directory.

@intergalacticspacehighway
intergalacticspacehighway / FlatListGapExample.jsx
Created February 28, 2023 01:14
Add gap in FlatList items with numColumns
import {Dimensions, FlatList, View} from 'react-native';
const screenWidth = Dimensions.get('window').width;
const numColumns = 2;
const gap = 5;
const availableSpace = screenWidth - (numColumns - 1) * gap;
const itemSize = availableSpace / numColumns;
const renderItem = ({item}) => {