Skip to content

Instantly share code, notes, and snippets.

View techraiders's full-sized avatar
🎯
Focusing

Navneet Prakash techraiders

🎯
Focusing
View GitHub Profile
@techraiders
techraiders / angular-expert-prompt.yaml
Created July 10, 2025 03:20
Angular Expert Prompt
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.
@techraiders
techraiders / config.yaml
Created July 9, 2025 05:40
Configuration to connect locally running LLM by Ollama to the Visual Studio Code (VS Code) Extention Continue
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
@techraiders
techraiders / framework-developer.txt
Last active June 12, 2018 07:36
How to become a JavaScript Framework or Libraries Developer
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!
<!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>
@techraiders
techraiders / fix-js-errors.js
Created January 21, 2018 06:11
Fixing common JavaScript errors
// 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.
@techraiders
techraiders / string-sort.txt
Created January 13, 2018 16:41
Sorting Strings with Accented 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();
@techraiders
techraiders / boolean-algebra.text
Last active January 12, 2018 19:41
Boolean Algebra
/**************** 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)
@techraiders
techraiders / javascript-Quirks.txt
Last active June 12, 2018 07:50
Debugging and Fixing Common JavaScript Errors
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.
@techraiders
techraiders / scrollTo.js
Created December 4, 2017 05:11
jQuery Scroller
/* 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);
});
@techraiders
techraiders / no-points.js
Last active January 29, 2018 08:41
Point Free Style in Functional Light JavaScript
function not (fn) {
return function negated(...args) {
return !fn(...args);
};
}
function isOdd(v) {
return v % 2 == 1;
}