Skip to content

Instantly share code, notes, and snippets.

@Integralist
Integralist / 1. Example.scss
Created October 22, 2012 14:10
Sass Mixin for CSS3 Animations
@include keyframe(fadeout) {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@extremecoders-re
extremecoders-re / vmware-no-vmem.md
Last active April 6, 2024 08:09
Boost VMWare Performance by disabling vmem files.

Prevent creation of vmmem files in VMware (Windows)

Issue

VMWare creates .vmem files to back the guest RAM. On the host this causes disk thrashing especially during powering on and off the guest.

Solution

Add the following lines to the .vmx file to prevent creation of .vmem files. This will reduce disk IO and VM performance will improve especially on non-SSD disks.

@ionurboz
ionurboz / debounce-throttle.md
Last active April 10, 2024 02:55
Simple JavaScript debounce and throttle (Pure, Vanilla, Plain JS)

If you've written any kind of validation on user input, like onkeypress then you'll know that sometimes you want to throttle the amount of times your function runs. A good example of this is Ajax based username validation - you don't want to hit the server on every key press, because most users will be able to write their name in around 1/10th of a second, so you should throttle the ajax request until the input is dormant for 100ms.

So with a bit of magic JavaScript making use of the ever useful closure JavaScript offers, we can create a simple method to handle this for us:

function debounce(fn, delay) {
  var timer = null;
  return function () {
    var context = this, args = arguments;
    clearTimeout(timer);
 timer = setTimeout(function () {
@tejpochiraju
tejpochiraju / offline_caching.js
Created November 27, 2020 07:03
Example showing how to download large objects from S3 and cache using IndexedDB
// Example showing how to download large objects from S3 and cache using IndexedDB
// Once downloaded, all future requests for the file are automatically served from IndexedDB.
// Offline caching module -
import Dexie from 'dexie';
import axios from 'axios';
const db = new Dexie('offline-blobs');
db.version(1).stores({
blobs: 'key,id, blob'
@elct9620
elct9620 / README.md
Created February 11, 2024 14:35
Hugo to Embedding Example

Hugo to Embedding Example

Convert Hugo articles to Embendding for Cloudflare Vectorize Store

Add JSON output to Hugo

The single.json is a example to add JSON outptu for your theme.

Setup a new config ai.toml to extend output