Skip to content

Instantly share code, notes, and snippets.

View iTonyYo's full-sized avatar
🎯
Focusing

Whoami iTonyYo

🎯
Focusing
  • California
View GitHub Profile
@iTonyYo
iTonyYo / javascript_engines_and_runtimes.md
Created February 26, 2024 01:14 — forked from guest271314/javascript_engines_and_runtimes.md
A list of JavaScript engines, runtimes, interpreters

V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.

SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be [compiled](https://bytecodealliance.org/articles/making-javascript-run-fast-on

@iTonyYo
iTonyYo / README.md
Created September 18, 2023 05:57 — forked from kfox/README.md
TCP echo server for Node.js

TCP echo server for Node.js

Usage

  1. Make sure you have a modern-ish version of Node.js installed.
  2. Type npx https://gist.github.com/kfox/1280c2f0ee8324067dba15300e0f2fd3
  3. Connect to it from a client, e.g. netcat or similar: nc localhost 9000
@iTonyYo
iTonyYo / activealiases.sh
Created August 23, 2022 08:15 — forked from virajkulkarni14/activealiases.sh
List of active aliases on Oh my zsh
-='cd -'
...=../..
....=../../..
.....=../../../..
......=../../../../..
1='cd -'
2='cd -2'
3='cd -3'
4='cd -4'
5='cd -5'
@iTonyYo
iTonyYo / README.md
Created January 25, 2021 01:08 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@iTonyYo
iTonyYo / modern_js.md
Created June 12, 2019 14:13 — forked from gaearon/modern_js.md
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@iTonyYo
iTonyYo / walksync.js
Created June 5, 2019 07:56 — forked from kethinov/walksync.js
List all files in a directory in Node.js recursively in a synchronous fashion
// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function(dir, filelist) {
var fs = fs || require('fs'),
files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function(file) {
if (fs.statSync(dir + file).isDirectory()) {
filelist = walkSync(dir + file + '/', filelist);
}
else {
@iTonyYo
iTonyYo / solid.js
Created May 3, 2019 14:16 — forked from crizstian/solid.js
Code examples of SOLID principles for JavaScript
/*
Code examples from the article: S.O.L.I.D The first 5 priciples of Object Oriented Design with JavaScript
https://medium.com/@cramirez92/s-o-l-i-d-the-first-5-priciples-of-object-oriented-design-with-javascript-790f6ac9b9fa#.7uj4n7rsa
*/
const shapeInterface = (state) => ({
type: 'shapeInterface',
area: () => state.area(state)
})
@iTonyYo
iTonyYo / reset.js
Created April 2, 2019 11:30 — forked from 19h/reset.js
Node.js — Clear Terminal / Console. Reset to initial state.
console.reset = function () {
return process.stdout.write('\033c');
}
git tag -am "annotation goes here" tagname_goes_here # cut a tag
git tag -d tagname_goes_here # burn it
git tag -am "annotation goes here" tagname_goes_here # cut another tag
git push --tags # push tags to remote
git push origin :refs/tags/tagname_goes_here # delete tag from remote
@iTonyYo
iTonyYo / webp2png.js
Created January 7, 2019 05:13 — forked from deepak1556/webp2png.js
webp support using libwebpjs (webp->png in canvas)
WebPDecodeAndDraw = function (data) {
var decoder = new WebPDecoder();
var bitmap = decoder.WebPDecode(data, data.length);
if (bitmap) {
//Draw Image
var output = ctx.createImageData(canvas.width, canvas.height);
var biWidth = canvas.width;
var outputData = output.data;