Skip to content

Instantly share code, notes, and snippets.

View kcmr's full-sized avatar

Kus Cámara kcmr

View GitHub Profile
@matthew-d-white
matthew-d-white / generativeaiglossary.txt
Last active February 4, 2024 14:08
Generative AI Glossary
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Term | Definition |
+----------------------------------------------------+------------------------------
@WebReflection
WebReflection / esx.md
Last active May 6, 2024 08:49
Proposal: an ESX for JS implementation
@ccnokes
ccnokes / heic_to_jpeg.sh
Last active November 21, 2022 16:06
Bash script that converts .HEIC to .jpg files
#!/bin/bash
set -eu -o pipefail
count=$(find . -depth 1 -name "*.HEIC" | wc -l | sed 's/[[:space:]]*//')
echo "converting $count files .HEIC files to .jpg"
magick mogrify -monitor -format jpg *.HEIC
echo "Remove .HEIC files? [y/n]"
@kcmr
kcmr / rename-element-to-polymerelement.js
Last active December 28, 2019 23:07
Codemod to replace the first block scope in a file by a IIFE
export default function(file, api) {
const j = api.jscodeshift;
return j(file.source)
.find(j.VariableDeclarator, {
id: {
type: 'Identifier',
name: 'Element',
},
})
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

@rockchalkwushock
rockchalkwushock / config.yml
Created October 4, 2017 16:52
Full config.yml from Medium Article
version: 2
jobs:
checkout_code:
docker:
- image: circleci/node:latest
working_directory: ~/circleci-deployment
steps:
- checkout
- attach_workspace:
at: ~/circleci-deployment
@kcmr
kcmr / gulpfile.js
Last active July 17, 2017 22:26
PSK 2 Custom Build with livereload and autoprefixer for elements
'use strict';
const requireDir = require('require-dir');
const tasks = requireDir('./tasks');
@praveenpuglia
praveenpuglia / shadow-dom.md
Last active March 28, 2024 15:06
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.

@samthor
samthor / safari-nomodule.js
Last active February 14, 2024 02:54
Safari 10.1 `nomodule` support
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that
// does not support `nomodule` is probably not being used anywhere. The code below is left
// for posterity.
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.: