Skip to content

Instantly share code, notes, and snippets.

@FbN
FbN / vite.config.js
Last active April 18, 2024 08:36
vite.config.js node built-in polyfills
// yarn add --dev @esbuild-plugins/node-globals-polyfill
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
// yarn add --dev @esbuild-plugins/node-modules-polyfill
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill'
// You don't need to add this to deps, it's included by @esbuild-plugins/node-modules-polyfill
import rollupNodePolyFill from 'rollup-plugin-node-polyfills'
export default {
resolve: {
alias: {
@alok87
alok87 / sendmail.go
Created October 21, 2015 10:10
Sendmail Using Golang without SMTP- Example
package main
import (
"io/ioutil"
"os/exec"
"fmt"
)
// EXAMPLE: echo "Subject: TestnHello" | sendmail -f you@domain.com you@domain.com
// Useful Links: https://gobyexample.com/spawning-processes
@IonsInTheEther
IonsInTheEther / plugin.groovy
Last active April 18, 2024 08:35
A JetBrains LivePlugin to collapse `class` attributes. Invaluable for Tailwind projects.
import com.intellij.codeInsight.folding.impl.EditorFoldingInfo
import com.intellij.codeInsight.folding.impl.FoldingUtil
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.editor.Document
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.FoldRegion
import com.intellij.openapi.editor.ex.FoldingModelEx
import java.util.regex.Pattern
import static liveplugin.PluginUtil.*
@manuel-schoebel
manuel-schoebel / api-log-route.ts
Last active April 18, 2024 08:32
next.js simple logger
import { NextRequest, NextResponse } from 'next/server';
export async function POST(request: NextRequest, res: NextResponse) {
const data = await request.json();
switch (data.level) {
case 'error':
console.error(data);
break;
case 'warn':
console.warn(data);

What to do when I have complited all my sprint items?

  1. DO NOTHING FOR 5 - 15 MINUTES.

    • get up and walk away from the keyboard. [go outside if possible]
    • drink tea,coffee,water,insert your beverage of choice here. [go outside if possible]
  2. Ask if you can help others in the team to complite their tasks, so the Sprint Goal can be achived. [help the team]

  3. Ask if you can help the product owner to prepare for future sprints. [help the project]

@ankjevel
ankjevel / clear-cache.sh
Last active April 18, 2024 08:31
clear npm cache (when using nvm); run with `nvm list | clear-cache`
#!/usr/bin/env bash
function clear-cache {
versions=()
while read -r line; do
clean="$(echo ${line} | sed "s,$(printf '\033')\\[[0-9;]*[a-zA-Z],,g")"
valid=$(echo "${clean}" | grep '^[^a-zA-Z]' | grep -v 'system' | sed 's/->//' | sed 's/\s.*v//')
if [[ ! -z $valid ]]; then
versions+=(${valid})
@tanmay27vats
tanmay27vats / function.php
Last active April 18, 2024 08:30
Remove "Product Type/Product Data" Dropdown Options - WooCommerce
add_filter( 'product_type_selector', 'remove_product_types' );
function remove_product_types( $types ){
unset( $types['grouped'] );
unset( $types['external'] );
unset( $types['variable'] );
return $types;
}

GitHub Search Syntax for Finding API Keys/Secrets/Tokens

As a security professional, it is important to conduct a thorough reconnaissance. With the increasing use of APIs nowadays, it has become paramount to keep access tokens and other API-related secrets secure in order to prevent leaks. However, despite technological advances, human error remains a factor, and many developers still unknowingly hardcode their API secrets into source code and commit them to public repositories. GitHub, being a widely popular platform for public code repositories, may inadvertently host such leaked secrets. To help identify these vulnerabilities, I have created a comprehensive search list using powerful search syntax that enables the search of thousands of leaked keys and secrets in a single search.

Search Syntax:

(path:*.{File_extension1} OR path:*.{File_extension-N}) AND ({Keyname1} OR {Keyname-N}) AND (({Signature/pattern1} OR {Signature/pattern-N}) AND ({PlatformTag1} OR {PlatformTag-N}))

Examples:

**1.

@fevangelou
fevangelou / my.cnf
Last active April 18, 2024 08:27
Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#