Skip to content

Instantly share code, notes, and snippets.

@ciiqr
ciiqr / zod-optional-null.ts
Last active May 19, 2024 16:29
zod optional/nullable/nullish differences
// zod schema
z.object({
// valid if string or:
optional: z.string().optional(), // field not provided, or explicitly `undefined`
nullable: z.string().nullable(), // field explicitly `null`
nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined`
});
// type
{
@zelon88
zelon88 / CloudIndexer.php
Last active May 19, 2024 16:18
Redirect users based on device or screen size
<!DOCTYPE html>
<title>Cloud Authentication</title>
<html lang="en-US">
<html>
<body>
<div align="center"><h1>Configuring your Cloud Drive ...</h1></div>
<div align="center"><img src="http://localhost/wp-content/uploads/2016/03/Cloud-Banner.png" alt="HonestRepair Cloud Storage"</div>
<div align="center"><img src="http://localhost/HRProprietary/pacman.gif" alt="PacMan is gathering information!" height="24" width="24"></div>
<div align="center"><strong>Please wait while we authenticate your account and adjust the Cloud to your device...</strong></div>
@lvthillo
lvthillo / pipeline.groovy
Last active May 19, 2024 16:03
Scripted Jenkins pipeline which uses Kubernetes plugin
podTemplate(label: 'mypod', containers: [
containerTemplate(name: 'git', image: 'alpine/git', ttyEnabled: true, command: 'cat'),
containerTemplate(name: 'maven', image: 'maven:3.3.9-jdk-8-alpine', command: 'cat', ttyEnabled: true),
containerTemplate(name: 'docker', image: 'docker', command: 'cat', ttyEnabled: true)
],
volumes: [
hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: '/var/run/docker.sock'),
]
) {
node('mypod') {
@JerryLokjianming
JerryLokjianming / Crack Sublime Text Windows and Linux.md
Last active May 19, 2024 15:48
Crack Sublime Text 3.2.2 Build 3211 and Sublime Text 4 Alpha 4098 with Hex

How to Crack Sublime Text 3.2.2 Build 3211 with Hex Editor (Windows | Without License) ↓

  1. Download & Install Sublime Text 3.2.2 Build 3211
  2. Visit https://hexed.it/
  3. Open file select sublime_text.exe
  4. Offset 0x8545: Original 84 -> 85
  5. Offset 0x08FF19: Original 75 -> EB
  6. Offset 0x1932C7: Original 75 -> 74 (remove UNREGISTERED in title bar, so no need to use a license)

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@nosoop
nosoop / makesig.idc
Created February 5, 2019 23:00
makesig.idc with fixes for IDA 7.0
#include <idc.idc>
/* makesig.idc: IDA script to automatically create and wildcard a function signature.
* Copyright 2014, Asher Baker
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
@SamWSoftware
SamWSoftware / launch.json
Created November 28, 2020 20:43
VS Code Debugging Launch JSON
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Serverless Offline",
@echo off
:======================================================================================================================================================
:Thanks to abbodi1406 for SppExtComObjPatcher-kms\2-Activate-Local.cmd, which used as base in this script
:Thanks to rpo for the Great and Continued help in improving this script.
:Thanks to AR_Alex for the ideas and suggestions.
:======================================================================================================================================================
::===========================================================================
fsutil dirty query %systemdrive% >nul 2>&1 || (
@beep
beep / ublock-twitterneue.txt
Last active May 19, 2024 15:15
uBlock Origin rules for new twitter website
# Block Twitter’s new web font
https://abs.twimg.com/fonts/chirp-bold-web.woff
https://abs.twimg.com/fonts/chirp-heavy-web.woff
https://abs.twimg.com/fonts/chirp-regular-web.woff
# hides engage-y modules from the rightmost sidebar
twitter.com##[data-testid="sidebarColumn"] div[aria-label]
twitter.com##[data-testid="sidebarColumn"] div:has(> aside[aria-label])
# hides promoted tweets