Skip to content

Instantly share code, notes, and snippets.

@mattdesl
mattdesl / modules.md
Last active October 12, 2024 16:17
my favourite modules.
@eiximenis
eiximenis / 01_1Scope.js
Created November 27, 2014 10:04
Ejemplos de la charla Una tapa de EcmaScript. PPT http://www.slideshare.net/eduardtomas/una-tapa-de-ecmascript-6
(function() {
const a=10;
a=20;
let b=10;
b=20;
console.log("a-->" + a);
console.log("b-->" + b);
var s = true;
while (s) {
const ic = 10;
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active April 15, 2026 14:56
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@JedWatson
JedWatson / API-Auth-With-KeystoneJS.md
Last active April 16, 2023 02:11
API Auth with KeystoneJS

To implement API authentication in KeystoneJS, you need the following:

For key based authentication

  • Middleware that validates the key in the request body or a header

For session based authentication

  • An endpoint that handles signin
  • An endpoint that handles signout
@leodutra
leodutra / bitwise-hacks.js
Last active April 5, 2026 14:02
Fast Int Math + Bitwise Hacks For JavaScript
/**
* Bitwise Mathematics Utilities
*
* A collection of fast bitwise operations for integer mathematics.
* These functions prioritize performance over readability and should be used
* when micro-optimizations are critical (game engines, real-time applications).
*
* References:
* - http://michalbe.blogspot.com.br/2013/03/javascript-less-known-parts-bitwise.html
* - http://jsperf.com/bitwise-vs-math-object
@datchley
datchley / README.md
Last active March 23, 2019 21:00
Micro templating library for javascript

Micro-Template: README.md

Valid template expressions:

  • expressions can reference any property on the passed in context, including nested properties and indexed access to array properties.
     {{ name }}
 {{ obj.name }}
function unhash(hash) {
var parts = [];
var letters = 'acdegilmnoprstuw';
while (hash !== 7) {
var index = hash % 37;
hash = (hash - index) / 37;
parts.unshift(letters[index]);
}
return parts.join('');
}
@delebash
delebash / kssnodetojson.js
Last active November 19, 2018 09:27
outputs kss to json string
//install kss and fs-extra: npm install kss fs-extra
var kss = require('kss'),
options = {
markdown: false
};
var fs = require('fs-extra');
var file = './docs/kss.json';
@michelsalib
michelsalib / timestampable.ts
Created April 22, 2015 15:52
Typescript @timestampable annotation
@timestampable
class Dog {
public name: string = 'Paul';
}
function timestampable(func) {
return <any>(function() {
var genericConstructor = () => {};
genericConstructor.prototype = func.prototype;
var instance = new genericConstructor();