Skip to content

Instantly share code, notes, and snippets.

View elvisisvan's full-sized avatar
🏠
Working from home

Elvis Van elvisisvan

🏠
Working from home
View GitHub Profile
@kennypete
kennypete / navigating_the_modes_of_Vim.md
Created April 18, 2024 20:46
Navigating the modes of Vim

Navigating the modes of Vim

This diagram illustrates navigating through Vim’s modes. It was built factoring Vim 9 (i.e., all its modes, including up to two new modes, cr and cvr, in November 2023). Information about the state() and 'showmode' is provided too.

SVG version

Some features are only available in the SVG version. It is not provided directly from within this gist’s files because SVGs do not always play nicely in GitHub (particularly, refusing to display embedded fonts).

The SVG version includes hover text help, which shows pertinent information about the underlying key, command, mode, etc.

@thecodeboss
thecodeboss / prisma-slonik-usage.ts
Created July 22, 2022 22:01
Prisma/Slonik Usage Example
import { PrismaClient } from '@prisma/client';
import type { User } from '@prisma/client';
import { createPool, sql } from 'slonik';
export const buildBaseConnectionURL = (config) => {
return (
'postgresql://' +
config.DB_USER +
':' +
config.DB_PASS +
@adrianhajdin
adrianhajdin / Transactions.sol
Last active May 7, 2024 14:14
Build and Deploy a Modern Web 3.0 Blockchain App | Solidity, Smart Contracts
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "hardhat/console.sol";
contract Transactions {
uint256 transactionCount;
event Transfer(address from, address receiver, uint amount, string message, uint256 timestamp, string account, string keyword);
@lucidhacker
lucidhacker / code.sh
Last active February 5, 2024 19:20 — forked from tallguyjenks/code.sh
ZettelKasten Sync Code
# update and upgrade installed packages
apt update && apt upgrade
# install cronie and termux-services
pkg install cronie termux-services
# enable the crond service
sv-enable crond
# install and enable vim
@sindresorhus
sindresorhus / esm-package.md
Last active May 20, 2024 14:52
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.
@FreddieOliveira
FreddieOliveira / docker.md
Last active May 20, 2024 05:40
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@Tamal
Tamal / set-chroot.sh
Last active April 26, 2024 09:57
Setting up chroot from a live image in Fedora. Regenerate grub2 for Fedora.
$ # Use Live CD to boot
$ sudo su # Switch to root
$ fdisk -l # Get names of root, boot & EFI partition names. you can also use blkid
$ mount /dev/mapper/fedora_localhost--live-root /mnt # mount root partition
$ cat /mnt/etc/fedora-release
Fedora release 31 (Thirty One)
$ mount /dev/nvme0n1p2 /mnt/boot # mount boot partition
$ mount /dev/nvme0n1p1 /mnt/boot/efi # mount EFI partition
# Note: If you are not able to mount EFI partition ('Input/Output error'),
# You may have to repair ESP file system or format ESP.
@wavezhang
wavezhang / java_download.sh
Last active May 21, 2024 14:36
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@DataWraith
DataWraith / COPYING
Last active May 15, 2024 02:22
A simple Tetris clone written in Java
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM