Skip to content

Instantly share code, notes, and snippets.

@vaban-ru
vaban-ru / awesomeMask.js
Last active May 19, 2024 12:56
Универсальная маска для России с помощью iMask.js
// ДЕМО: https://codepen.io/vtboren/pen/ZdGRXp
// Подключаем скрипт маски https://unmanner.github.io/imaskjs/
// Функция маски
// Работает сразу на все поля с типом поля tel
function initPhoneMask() {
$('input[type=tel]').each(function(index, element) {
var mask = IMask(element, {
mask: [
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
function copyFolderSync(source, destination, excludeDirs) {
if (!fs.existsSync(destination)) {
fs.mkdirSync(destination, { recursive: true });
}
const items = fs.readdirSync(source, { withFileTypes: true });
@tannerlinsley
tannerlinsley / useGlobalMemo.js
Created August 28, 2020 23:45
useGlobalMemo is a React hook that lets you share memoizations across an entire app using a unique key.
const cache = {}
export default function useGlobalMemo (key, fn, deps) {
if (!cache[key]) {
cache[key] = {
subs: 0,
deps,
value: fn(),
}
@devinschumacher
devinschumacher / cloud-gpus.md
Last active May 19, 2024 12:50
Cloud GPUs // The Best Servers, Services & Providers [RANKED!]

Cloud GPUs: Servers, Providers & Everything You Would Ever Need

Your company's GPU computing strategy is essential whether you engage in 3D visualization, machine learning, AI, or any other form of intensive computing.

There was a time when businesses had to wait for long periods of time while deep learning models were being trained and processed. Because it was time-consuming, costly, and created space and organization problems, it reduced their output.

This problem has been resolved in the most recent GPU designs. Because of their high parallel processing efficiency, they are well-suited for handling large calculations and speeding up the training of your AI models.

When it comes to deep learning, GPUs can speed up the training of neural networks by a factor of 250 compared to CPUs, and the latest generation of cloud GPUs is reshaping data science and other emerging technologies by delivering even greater performance at a lower cost and with the added benefits of easy scalability and rapid deployment.

@HarmJ0y
HarmJ0y / PowerView-3.0-tricks.ps1
Last active May 19, 2024 12:47
PowerView-3.0 tips and tricks
# PowerView's last major overhaul is detailed here: http://www.harmj0y.net/blog/powershell/make-powerview-great-again/
# tricks for the 'old' PowerView are at https://gist.github.com/HarmJ0y/3328d954607d71362e3c
# the most up-to-date version of PowerView will always be in the dev branch of PowerSploit:
# https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1
# New function naming schema:
# Verbs:
# Get : retrieve full raw data sets
# Find : ‘find’ specific data entries in a data set
#include <BleGamepad.h>
BleGamepad bleGamepad;
int btn_last = 0;
int btn_pin = 4;
int poti_pin = 34;
int con = 0;
void setup()
{
# thanks to Vinz1911 (https://github.com/Vinz1911/PrimePoweredUP) for the BLE handling
from spike import PrimeHub, LightMatrix, Button, StatusLight, ForceSensor, MotionSensor, Speaker, ColorSensor, App, DistanceSensor, Motor, MotorPair
from spike.control import wait_for_seconds, wait_until, Timer
from math import *
import utime
import ubluetooth
import ubinascii
@MichaelLawton
MichaelLawton / deleteAmazonSavedItems.js
Last active May 19, 2024 12:48
Removes all Amazon saved for later items on the cart page. It will only remove visible items. You might want to scroll first to make more items visible. To use paste code in developer console (Ctrl+Shift+J or Cmd+Opt+J in Chrome) then press enter.
function deleteSavedItems() {
var query = document.querySelectorAll("#sc-saved-cart input[value=Delete]")
if (query.length) {
query[0].click();
}
if (query.length > 1) {
setTimeout(deleteSavedItems,100);
}
else {
console.log('Finished');
@abobija
abobija / esp-idf-on-wsl2.md
Last active May 19, 2024 12:43
ESP-IDF on WSL2 - Build, Flash and Monitor

ESP-IDF on WSL2 - Build, Flash and Monitor ⚡

Demo

How to setup ESP-IDF on WSL2 Ubuntu 20.04 - Config, Build and Flash

Intro

WSL2 still does not support USB devices, but with a little effort we can make possible to flash and monitor ESP device from WSL2.

@ahmadshah
ahmadshah / componentA.vue
Created June 24, 2016 07:49
Vuejs Event Emitter
<template>
<button @click="emitEvent">EVENT</button>
</template>
<script>
import { EV } from './events'
export default {
methods: {
emitEvent() {