Skip to content

Instantly share code, notes, and snippets.

View Starsign68's full-sized avatar
🇺🇦
#StandWithUkraine

Starsign68 Starsign68

🇺🇦
#StandWithUkraine
View GitHub Profile
@fredjoseph
fredjoseph / chrome.md
Last active January 27, 2024 15:05
Chrome

Tips

Flags (chrome://flags)

  • Password Import: Import functionality in password settings.
  • Smooth Scrolling: Animate smoothly when scrolling page content (à désactiver en cas de lenteur sur le scrolling)
  • Insecure origins treated as secure: Treat given (insecure) origins as secure origins. Useful for testing a feature that requires a secure origin (https)

View the storage of an extension

Open the Chrome Devtool by clicking on the background page of an extension in Chrome://extensions/ (Developer mode needs to be checked to see background pages).

  • For localStorage: you can see the local storage on the left.
  • For storage.local: you can see this sorage in the console thnaks to the following command chrome.storage.local.get(function(result){console.log(result)})
@interaminense
interaminense / utils.js
Last active July 7, 2021 20:37
Utils for JS
/**
* Util Create DOM using literal templates
*/
const createElement = tmpl => new DOMParser().parseFromString(tmpl, 'text/html').body.firstChild;
/**
* Util Object Builder
*/
const builder = (newList = []) => {
let list = newList;
@Deepak13245
Deepak13245 / utils.js
Last active July 7, 2021 19:22
Few js utilities
async function measure(promise) {
const start = Date.now();
try {
const result = await promise;
return result;
} catch(e) {
throw e;
} finally {
const time = Date.now() - start;
console.log(`Time taken ${time} ms`);
@rob-kistner
rob-kistner / domTools.js
Last active July 7, 2021 19:19
Javascript Utilities
/* ----------------------------------------
domTools.js
A number of wrapper and shortcut functions
meant to imitate features of jquery and
otherwise simplifying their vanilla js counterparts
without the jquery overhead.
---------------------------------------- */
// aliases
@iwalton3
iwalton3 / prompt.bash
Created March 6, 2020 23:17
BASH Prompt and Aliases
#BEGIN prompt code
function makePrompt {
local pred="\[\033[0;31m\]"
local pyellow="\[\033[1;33m\]"
bold=$'\e[1m'; underline=$'\e[4m'; dim=$'\e[2m'; strickthrough=$'\e[9m'; blink=$'\e[5m'; reverse=$'\e[7m'; hidden=$'\e[8m'; normal=$'\e[0m'; black=$'\e[30m'; red=$'\e[31m'; green=$'\e[32m'; orange=$'\e[33m'; blue=$'\e[34m'; purple=$'\e[35m'; aqua=$'\e[36m'; gray=$'\e[37m'; darkgray=$'\e[90m'; lightred=$'\e[91m'; lightgreen=$'\e[92m'; lightyellow=$'\e[93m'; lightblue=$'\e[94m'; lightpurple=$'\e[95m'; lightaqua=$'\e[96m'; white=$'\e[97m'; default=$'\e[39m'; BLACK=$'\e[40m'; RED=$'\e[41m'; GREEN=$'\e[42m'; ORANGE=$'\e[43m'; BLUE=$'\e[44m'; PURPLE=$'\e[45m'; AQUA=$'\e[46m'; GRAY=$'\e[47m'; DARKGRAY=$'\e[100m'; LIGHTRED=$'\e[101m'; LIGHTGREEN=$'\e[102m'; LIGHTYELLOW=$'\e[103m'; LIGHTBLUE=$'\e[104m'; LIGHTPURPLE=$'\e[105m'; LIGHTAQUA=$'\e[106m'; WHITE=$'\e[107m'; DEFAULT=$'\e[49m';
tabChar=$'\t'
@beeFlaherty
beeFlaherty / utilities.js
Last active July 7, 2021 19:23
Javascript utilities
'use strict';
//Here's the basic JavaScript debounce function (as taken from Underscore.js):
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
@apfelchips
apfelchips / user.js
Last active February 26, 2024 04:21
~ 🥖.config🥖firefox🥖Profiles🥖profile.default🥖user.js
// src: https://gist.github.com/apfelchips/f129c8316055e524774d757365267e26
// goal: disable all annoying stuff from firefox and tighten security, but still retain all modern web features
// configure as little as possible to benefit from changeing/hardened defaults by Mozilla
// inspired by:
// https://github.com/pyllyukko/user.js/blob/master/user.js
// https://github.com/ghacksuserjs/ghacks-user.js/blob/master/user.js
// http://kb.mozillazine.org/About:config_entries
// https://gist.github.com/ruilapa/3207798
@LucaRosaldi
LucaRosaldi / utils.js
Last active July 7, 2021 19:22
JS: utilities module
/**
* Check if passed argument is a callable function.
*
* @param {Callable} func
* @return {Boolean}
*/
export function isFunction( func ) {
return func && {}.toString.call( func ) === '[object Function]';
}
@WebReflection
WebReflection / custom-elements-pattern.md
Last active February 14, 2024 00:13
Handy Custom Elements' Patterns

Handy Custom Elements' Patterns

Ricardo Gomez Angel Photo by Ricardo Gomez Angel on Unsplash

This gist is a collection of common patterns I've personally used here and there with Custom Elements.

These patterns are all basic suggestions that could be improved, enriched, readapted, accordingly with your needs.