This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Angular Expert Prompt | |
version: 0.0.1 | |
schema: v1 | |
prompts: | |
- name: Angular Expert Assistant | |
description: Assists users with generating high-quality Angular code and best practices | |
prompt: | | |
You are an expert frontend developer specializing in **Angular 17+**, TypeScript, RxJS, NgRx, and modern web development practices. | |
Your role is to assist users in generating high-quality Angular code while adhering to best practices. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Local Assistant | |
version: 1.0.0 | |
schema: v1 | |
models: | |
- name: Deepseek-R1-8B | |
provider: ollama | |
model: deepseek-r1:8b | |
apiBase: http://localhost:11434 | |
roles: | |
- apply |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Randy Casburn: | |
functional programming; micro-optimization; learn performance differences between different ways of accomplishing the same outcomes; use js-perf a lot; learn to use performance.now(). | |
Why focus on performance? What is the first criticism about any modern framework? Why is there AngularJS vs. Angular(2-5)? Why is there React vs. Preact, etc. | |
If you want to write the next killer framework your work will be judged on performance first - the structural, ease of use and helpful features value will be secondary. We, as an industry, have proven this over and over again. | |
Best of luck! | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="Proxy Array Push"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fixing jQuery failed to load | |
if (!window.$) { | |
console.error('jQuery failed to load.'); | |
document.body.innerHTML = '<h1> Sorry! Something terrible happened. Are you in an elevator? Try again. </h1>' + | |
'<div> If you have lots of problems, email us at hello_navneet@hotmail.com </div>'; | |
} | |
/* NETWORK/PROXY BUG: The stripe API drop their javascript API on your page, and decrorate the form. It says this field in the form is the credit card number. This field in the form is the expiration date. This field in the form is the checksum CVV number. One you're done the stripe library would intercept the form, and go and process the credit card for you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Strings can create a whole host of problems within any programming language. Whether it's a simple string, a string containing emojis, html entities, and even accented characters, if we don't scrub data or make the right string handling choices, we can be in a world of hurt. | |
While looking through Joel Lovera's JSTips repo, I spotted a string case that I hadn't run into yet (...I probably have but didn't notice it): sorting accented characters to get the desired outcome. The truth is that accented characters are handled a bit differently than you'd think during a sort: | |
// Spanish | |
['único','árbol', 'cosas', 'fútbol'].sort(); | |
// ["cosas", "fútbol", "árbol", "único"] // bad order | |
// German | |
['Woche', 'wöchentlich', 'wäre', 'Wann'].sort(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************** BOOLEAN LAWS | BOOLEAN ALGEBRA ***************/ | |
1. Commutative law: Any binary operation which satisfies the following expression is referred to as commutative operation. | |
i. A.B = B.A | |
ii. A + B = B + A | |
Commutative law states that changing the sequence of variables does not have any effect on the output of a logic value. | |
2. Associative law: This law states that the order in which the logic operations are performed is irrelevant as their effect is the same. | |
i. (A.B).C = A.(B.C) | |
ii. (A+B)+C = A+(B+C) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. String.length returns number of bytes taken by the string, not number of characters. | |
2. 0.1 + 0.2 returns 0.3000000000004 javascript floating point operations overflows the rounding precision, | |
we need to use the toPrecision function to guarantee that we get the correct. | |
3. new Date(2016, 5, 31): returns 2016 July 1 because months when constructing date, and only months are 0 based. 31st date of June doesn't exsit so it overflows to July 1. | |
4. new Array(0, 1 Array(2)): returns [0, 1, [undefined, undefined]]: Instantiating an Array with multiple arguments creates an Array from those values. However a single argument only specifies the length. | |
5. [10, 5, 1].sort() : Array.prototype.sort's default comparator assumes String operations. All values are coerced and compared as Strings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* If you need to scroll to a specific location on the page this little custom jQuery function can help you out. This snippet will help you scroll to a particular section based on the element you choose. | |
Add this little snippet inside your scripts file. | |
*/ | |
$.fn.scrollView = function () { | |
return this.each(function () { | |
$('html, body').animate({ | |
scrollTop: $(this).offset().top | |
}, 1000); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function not (fn) { | |
return function negated(...args) { | |
return !fn(...args); | |
}; | |
} | |
function isOdd(v) { | |
return v % 2 == 1; | |
} |
NewerOlder