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}) => {
@ahmadawais
ahmadawais / flywheel-local-xdebug-vscode.md
Last active May 3, 2024 12:07
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install
@nfsarmento
nfsarmento / nginx-wordpress.conf
Last active May 3, 2024 12:07
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
@stuartw1
stuartw1 / install-openvpn3-kali.sh
Last active May 3, 2024 12:04
install openvpn3 and dependencies on Kali Linux
#!/bin/bash
# The following commands should install openvpn3 successfully on Kali Linux as of 2023-10-11
# Please check libssl1.1 version is newest at https://packages.debian.org/bullseye/amd64/libssl1.1
# PM me if broken and I will update
# Thanks to the following for bug reports / additions
# asingh-lp, Pyr0technicien
# update packages
sudo apt update

Complete Genshin Impact Discord Quest:

First way which will work for any Quests not just Genshin, though it needs some knowledge 🤓:

  1. Accept the quest under User Settings -> Gift Inventory.
  2. Join a vc to your alt or your friend.
  3. Stream any window
  4. Press Ctrl + Shift + I to open DevTools
  5. Go to the Console tab
  6. Paste this code and press enter:
@gareve
gareve / contra_enemy_hp_stats_and_force_loop.lua
Created June 5, 2023 23:51
[Contra NES][Memory Inspection] Enemy HP Stats research for Difficulty/Loop Challenge
--[[
This script renders the enemy HP in screen + forces a difficulty/loop level
Made with the help of the followin apps & resources
bizhawk@Linux = monocomplete + libopenal1
Game Genius Addresses: https://gamehacking.org/game/29281
Contra Lua Sample Code: https://www.romhacking.net/games/137/
HP of enemies in final level
@d0iasm
d0iasm / doubly_linked_list.pseudocode
Created February 3, 2024 10:24
Pseudocode - Doubly Linked List
Node:
init:
self.data = data
self.next = None
self.prev = None
DoublyLinkedList:
init:
self.head = None
self.tail = None
@d0iasm
d0iasm / doubly_linked_list.rs
Created February 3, 2024 10:18
Template - Doubly Linked List in Rust
struct Node<T> {
}
struct DoublyLinkedList<T> {
}
impl<T> DoublyLinkedList<T> {
/// Removes the last element from a list and returns it, or None if it is empty.
/// This operation should compute in O(1) time.
fn pop_back(&mut self) -> Option<T> {
@zcyemi
zcyemi / JsonHelper.cs
Created March 14, 2018 13:51
Json.Net.JsonConverter for Unity Vector struct.
using UnityEngine;
using Newtonsoft.Json;
using System;
public class Vec4Conv : JsonConverter
{
public override bool CanConvert(Type objectType)
{
if (objectType == typeof(Vector4))