Skip to content

Instantly share code, notes, and snippets.

View leonardssh's full-sized avatar
:shipit:
<Esc>:wq!<Ret>

Narcis-Ionuț B. leonardssh

:shipit:
<Esc>:wq!<Ret>
View GitHub Profile
@shunwitter
shunwitter / KeyboardAvoidingView.jsx
Last active February 20, 2024 01:00
My KeyboardAvoidingView fixing annoying issues
/* eslint-disable */
import React, { useRef, useState, useEffect } from 'react'
import {
Keyboard, Dimensions, Animated
} from 'react-native'
const KeyboardSafeView = ({ children, style }) => {
const initialViewHeight = useRef(null)
const animatedViewHeight = useRef(null)
const [viewHeight, setViewHeight] = useState(null)
#!/bin/bash
blueutil -p 0
sleep 1
blueutil -p 1
@mjackson
mjackson / download-counts.mjs
Last active November 11, 2022 05:43
Download counts for react-router
const npmApiUrl = "https://api.npmjs.org/downloads/point";
async function fetchDownloadCounts(packageName, year) {
let range = `${year}-01-01:${year}-12-31`;
let response = await fetch(`${npmApiUrl}/${range}/${packageName}`);
return (await response.json()).downloads;
}
async function getDownloads(startYear, endYear = startYear) {
if (endYear < startYear) {
class CrashDebug {
constructor() {
this.definitions = [];
this.ignoreList = [
'mp.game.system.vdist',
'mp.game.waitAsync',
'mp.game.controls.disableControlAction',
'mp.game.joaat',
'mp.game.entity.createModelHide',
'mp.game.pad.disableControlAction'
@d-513
d-513 / arch-ovh.md
Last active October 9, 2023 18:38
Arch Linux on OVH VPS

Install Arch on OVH VPS

This guide will show you how to install Arch Linux on an OVH VPS.
As you may have noticed, OVH does not have an Arch image, which is a problem. Follow these instructions to install Arch using recovery mode.

Conventions

Assume anything reffered to as low ram vps in the guide to be a VPS with <8gb ram

This guide assumes the following:

  • Your VPS has one drive
@Cheaterman
Cheaterman / python.py
Last active November 11, 2022 16:19
Basic PySAMP+SQLAlchemy example
from samp import (
MAX_PLAYERS,
GetPlayerName,
GetPlayerScore,
IsPlayerConnected,
KillTimer,
SendClientMessage,
SetPlayerScore,
SetTimer,
)
@kewp
kewp / watch.js
Created March 1, 2022 10:58
Reload vite process when file changes (for plugin development)
// this is for when you want to have vite reload when you change
// a plugin you're working on locally.
// i.e. in vite.config.js:
// import plugin from 'my-plugin';
// export default {
//. plugins: [plugin()]
// }
// where your plugin is linked using npm link (or pnpm link)
// and you want your example / test project to reload as soon as you change
// the source of your plugin (in a separate folder / repo).
@duydang2311
duydang2311 / index.d.ts
Last active April 11, 2022 03:45
[TS] Enums of CSS colors.
declare const enum Color {
AliceBlue = '#f0f8ff',
AntiqueWhite = '#faebd7',
Aqua = '#00ffff',
AquaMarine = '#7fffd4',
Azure = '#f0ffff',
Beige = '#f5f5dc',
Bisque = '#ffe4c4',
Black = '#000000',
BlanchedAlmond = '#ffebcd',
@favna
favna / subcommands-with-manager-property.ts
Last active April 10, 2022 20:45
[REVISION 2] Sapphire Subcommands v3 for framework v3
import type { Args, ChatInputCommand, MessageCommand } from '@sapphire/framework';
import {
ChatInputSubcommandGroupMappings,
ChatInputSubcommandMappings,
MessageSubcommandGroupMappings,
MessageSubcommandMappings,
SubCommand,
SubcommandMappingsArray
} from '@sapphire/plugin-subcommands';
import type { CommandInteraction, Message } from 'discord.js';
trigger:
- main
pool:
vmImage: ubuntu-latest
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm
steps:
- task: Cache@2