var welcome_user = new Template('#{welcome} #{name}!!');
welcome_user.parse({ welcome: "Hello", name: "John" });
//returns "Hello John!!"
welcome_user.parse({ welcome: "Hola", name: "Peter" });
// Photoshop Script for Optimizing Images for the Web - Saves images as optimized jpeg | |
// Written by: Livingston Samuel | |
// Version 1.0.0 | |
// Required Adobe Photoshop CS 2 and above | |
//Enable double clicking on Mac Finder & Windows Explorer | |
#target Photoshop | |
//Bring app to front | |
app.bringToFront() |
-
Take input dependency graph and start traversing it, as you visit new node in the graph - clone it if there can be multiple paths to access the node from the graph root to the node, e.g. essentially represent the graph with a tree as you go, to make hoisting possible.
-
You want to hoist every node possible to the top root node first, then to each of its children etc, so you need to keep track what is your current root node into which you are hoisting
-
Traverse the dependency graph from the current root node and for each package name that can be potentially hoisted to the current root node build a list of idents in descending hoisting preference. You will check in next steps whether most preferred ident for the given package name can be hoisted first, and if not, then you check the less preferred ident, etc, until either some ident will be hoisted or you run out of idents to check (no need to convert the graph to the tree when you build this prefe
- https://github.com/mhassan1/yarn-plugin-after-install
- https://github.com/voodooattack/yarn-plugin-workspaces-watch
- https://github.com/mhassan1/yarn-plugin-plugin-manager
- https://github.com/TheKnarf/yarn-plugin-envinfo
- https://github.com/zwade/yarn-plugin-script-daemon
- https://github.com/RuBAN-GT/yarn-plugin-enhanced-workspaces
- https://github.com/dradetsky/yarn-plugin-xinit
- https://github.com/zemd/yarn-plugin-wait
Hook | Description |
---|---|
registerPackageExtensions |
Called when the package extensions are setup |
setupScriptEnvironment |
Called before a script is executed |
wrapScriptExecution |
Called as a script is getting executed |
wrapNetworkRequest |
Called when a network request is being made |
globalHashGeneration |
Called before the build, to compute a global hash key that we will use to detect whether packages must be rebuilt (typically when the Node version changes) |
reduceDependency |
Called during the resolution, once for each resolved package and each of their dependencies |
Created a login form with an SVG avatar that responds to the input in the email field. Used the GSAP TweenMax library + GSAP's MorphSVG plugin for the animating.
Email validation is very simple and crude just for the purposes of getting this prototype working.
/* 1. Life, the Universe, and Everything | |
Problem code: TEST | |
Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. | |
More precisely... rewrite small numbers from input to output. Stop processing input after reading in the number 42. | |
All numbers at input are integers of one or two digits. | |
Example: | |
Input: 1 2 88 42 99 | |
Output: 1 2 88 | |
*/ |
/* Collection of DOM Helper Methods | |
* Livingston Samuel | |
*/ | |
var DOM = {}; | |
/* Get Next Element node Sibling - Equivalent of nextElementSibling */ | |
DOM.next = function (elem) { | |
var sibling = elem.nextSibling; |
(function (global) { | |
if ( !global.Event && !('keys' in Object) && !('bind' in Function) ) { return } | |
var eventProto = Event.prototype, | |
EVENTS = { | |
'mouse': [ 'click', 'dblclick', 'contextmenu', 'mousedown', 'mouseup', 'mouseover', 'mousemove', 'mouseout', 'drag', 'dragend', 'dragenter', 'dragleave', 'dragover', 'drop'], | |
'key': [ 'keydown', 'keypress', 'keyup', 'input'], | |
'res': [ 'load', 'unload', 'beforeunload', 'abort', 'error', 'resize', 'scroll', 'readystatechange' ], | |
'form': [ 'select', 'change', 'submit', 'reset', 'focus', 'blur' ], | |
'ui': [ 'DOMFocusIn', 'DOMFocusOut', 'DOMActivate', 'DOMCharacterDataModified', 'DOMNodeInserted', 'DOMNodeRemoved', 'DOMSubtreeModified' ], |
/* IP2Decimal.js - converts IP address to decimal format | |
* @author - Livingston Samuel | |
*/ | |
var IP2Decimal = function (ip) { | |
var ipSyntax = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, ipArr, i = 4, decVal = 0; | |
if (ipSyntax.test(ip)) { | |
ipArr = ip.split("."); |