Skip to content

Instantly share code, notes, and snippets.

@remorses
remorses / renamer.ts
Last active May 4, 2024 19:40
Babel `BatchRenamer`, 100x faster babel `scope.rename()` when you have many identifier to rename
// original https://github.com/babel/babel/blob/9c77558234c87b9220604fbc1519089e2d6334e2/packages/babel-traverse/src/scope/lib/renamer.ts#L61
import splitExportDeclaration from '@babel/helper-split-export-declaration'
import type { Scope } from '@babel/traverse'
import { visitors } from '@babel/traverse'
import { traverseNode } from '@babel/traverse/lib/traverse-node'
import * as t from '@babel/types'
import { NodePath, Visitor } from '@babel/core'
import type { Identifier } from '@babel/types'
@jeznag
jeznag / check_that_message_can_be_sent.ds
Created March 6, 2024 04:19
Zoho Desk integration via Zoho Flow
map check_that_message_can_be_sent(int ticket_id, string sms_content, string send_btn_state, string channel, int desk_org_id)
{
try
{
if(channel != "SMS via Zoho Flow" || sms_content.isEmpty() || send_btn_state != "true")
{
info "stop processing outbound";
info "channel> " + channel;
info "sms_content> " + sms_content;
info "send_btn_state> " + send_btn_state;

An guide how to activate Windows 11 Pro for free

Why?

Because you will get some more features like an Bitlocker and host your device as an External Desktop which can be accessed through the internet

Am i also able to switch from any other edition to Pro?

The answer is yes! You can switch from almost any edition to Pro completely for free!

Note for users with unactivated Pro edition

People which already have Pro, but not activated, can skip to this step.

Getting started

What you first need to do is open CMD (Command Prompt) as Administrator using this keyboard key:

//
// DefaultAnimationWithAnimation.swift
// OpenSwiftUIAnimations
//
// Created by Amos Gyamfi on 16.3.2024.
//
import SwiftUI
struct DefaultAnimationWithAnimation: View {
import hotkeys, { HotkeysEvent } from 'hotkeys-js';
import { useEffect, useCallback } from 'preact/hooks';
/**
* A Preact hook for triggering side-effects when pressing hotkeys.
*
* @param keys A comma-separated list of hotkeys to trigger the callback on.
* @param callback A callback function to execute when keys are pressed.
* @param dependencies A list of dependencies.
*/
@Na-Nazhou
Na-Nazhou / mactex.md
Last active May 4, 2024 19:26
Install MacTex on MacOS

macOS version: 10.15.6

  1. Install MacTex with Homebrew
brew cask install mactex-no-gui
  1. Updating the packages
sudo tlmgr update --self && sudo tlmgr update --all
@tomnomnom
tomnomnom / simple-json-api.go
Created December 20, 2014 16:34
Simple JSON API Server in Go
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
)
// The `json:"whatever"` bit is a way to tell the JSON
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active May 4, 2024 19:24
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@unbracketed
unbracketed / branch-fu.md
Created April 7, 2015 17:49
Moving commits between branches

Example: Moving up to a few commits to another branch

Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.

cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated

git checkout branch-B
git cherry-pick X
git cherry-pick Y
@prestwich
prestwich / scriptsig.md
Last active May 4, 2024 19:16
But what is a scriptsig?

What is a ScriptSig anyway?

Bitcoin legacy transactions (and Zcash transparent sends) use "ScriptSigs" to prove authorization. A ScriptSig contains the user's signature andm maybe some other information. They let the protocol check that the tx came from someone allowed to spend those Bitcoin. Most users never interact with them directly, and with the advent of SegWit, they're slowly being phased out of Bitcoin. But it's still worth knowing how they work.

Basics