Skip to content

Instantly share code, notes, and snippets.

@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}) => {
@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active April 25, 2024 08:34
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

@rocarvaj
rocarvaj / .vimrc
Created April 27, 2012 21:28
Minimal .vimrc for C/C++ developers
" VIM Configuration File
" Description: Optimized for C/C++ development, but useful also for other things.
" Author: Gerhard Gappmeier
"
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)
@michaelfox
michaelfox / vimrc
Created January 6, 2012 19:35
Basic / Simple vimrc config file
set nocompatible
set encoding=utf-8
set hidden
filetype plugin indent on
syntax on
set synmaxcol=2048 " Don't syntax highlight super-long lines (for performance)
set autoindent " automatically indent lines and try to do it intelligently
set smartindent
set backspace=indent,eol,start " backspace behaves 'normally'
@simonista
simonista / .vimrc
Last active April 25, 2024 08:31
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
http://goaccess.io/man
** install **
apt-get install goaccess
cd /var/log/nginx
**main logs**
zcat access.log.*.gz | goaccess access.log --log-format=COMBINED -o /var/www/sitename.com/htdocs/report-server.html
@roommen
roommen / OpenSSH Update Script - Amazon Linux 2
Last active April 25, 2024 08:27
OpenSSH Update Script - Amazon Linux 2
#!/bin/bash
sudo yum install gcc -y
sudo yum install openssl-devel -y
sudo yum install zlib-devel -y
sudo yum install mlocate -y
sudo yum install autoconf -y
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.1p1.tar.gz
tar zxvf openssh-9.1p1.tar.gz
cd openssh-9.1p1 && ./configure && make && sudo make install
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active April 25, 2024 08:24
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active April 25, 2024 08:20
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail