Skip to content

Instantly share code, notes, and snippets.

View liady's full-sized avatar

Liad Yosef liady

View GitHub Profile
@liady
liady / vscode-types-settings.json
Last active May 20, 2022 21:22
Color settings for dimming type annotations in VSCode, change "foreground" as you wish
{
"editor.semanticHighlighting.enabled": false,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"support.type.primitive.ts",
"entity.name.type.ts",
"meta.type.tuple.ts",
"meta.type.annotation.ts",
@liady
liady / lockBower.js
Last active November 8, 2017 22:42
Node script for creating a 'bower-lock.json' with exact versions
const fs = require('fs');
const path = require('path');
const resolve = (...args) => path.join(__dirname, ...args);
const lockedVersions = getPackageVersions(resolve('bower_components'));
const newBowerContents = buildNewBowerContents(lockedVersions);
console.log(`Writing to bower-lock.json`);
fs.writeFileSync(resolve('./bower-lock.json'), newBowerContents, 'utf8');
@liady
liady / ultimate-ut-cheat-sheet.md
Created April 13, 2017 23:20 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


/**
* This solves the problem using Lodash's _.reduceRight,
* it runs backwards on the array, and makes each function/int to trigger the next ones
*/
function sequence(list = []){
_.reduceRight(list, (next, item) => () => _.isFunction(item) ? next(item()): setTimeout(next, item), () => {})();
}
/**
* This solves it without using iteration, but tail recursion,
@liady
liady / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@liady
liady / designer.html
Created October 22, 2014 11:54
designer
<link rel="import" href="../ace-element/ace-element.html">
<link rel="import" href="../cool-clock/cool-clock.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
function Lockable() {
this.deferred = $.Deferred();
this.locks = {};
}
Lockable.prototype.lock = function (lockName) {
this.locks[lockName] = true;
return this;
}