Skip to content

Instantly share code, notes, and snippets.

@nuthanc
nuthanc / curry.js
Created February 19, 2025 01:01
Initial curry
/**
* @param {Function} func
* @return {Function}
*/
export default function curry(func) {
const args = arguments;
if (args.length === 0) {
return func;
}
@nuthanc
nuthanc / App.js
Created August 29, 2024 00:57
My timer
import { useRef, useState } from "react";
import "./styles.css";
export default function App() {
const [minutes, setMinutes] = useState("05");
const [seconds, setSeconds] = useState("00");
const interval = useRef();
const start = () => {
if (interval.current) {
@nuthanc
nuthanc / settings.json
Created April 28, 2023 12:58
vs code settings.json
{
"workbench.colorTheme": "Dracula",
"workbench.startupEditor": "none",
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1,
"terminal.integrated.defaultProfile.osx": "zsh",
"security.workspace.trust.untrustedFiles": "open",
"editor.minimap.enabled": false,
"explorer.confirmDelete": false,
"editor.wordWrap": "bounded",
@nuthanc
nuthanc / chess.md
Last active May 17, 2024 12:00
Chess Gist

Things to think

  • Prioritize Forcing sequence to limit your opponent's replies
  • Check all Checks(including Queen checks), Captures and Mating threats
  • 3 Golden Principles
    • Weaknesses in the last move
    • Emerging Killer Common Squares
    • In-effect Clause(Opening or Gap from the previous move)
  • Keep track of emerging opportunites when calculating
  • These new emerging opportunites arrive when you check Forcing moves
@nuthanc
nuthanc / app.component.html
Created June 24, 2022 04:03
Starter app.component.html
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->
<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * Delete the template below * * * * * * * * * * -->
<!-- * * * * * * * to get started with your project! * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<style>
@nuthanc
nuthanc / minValid.java
Created April 25, 2022 14:24
Java min valid
import java.util.ArrayDeque;
class Solution {
public String minRemoveToMakeValid(String s) { // "lee(t(c)o)de)"
String[] result = s.split("") ;
ArrayDeque<Integer> stack = new ArrayDeque<>();
String openingBracket = "(";
String closingBracket = ")";
for(int i=0; i < result.length; i++) {
String ch = result[i];
@nuthanc
nuthanc / questions.txt
Created March 18, 2022 14:33
Newton School Assignment Problems
* Recursion(new) - Post Class - Room (Contest)
* Recursion(new) - Post Class - Black and White
* GCD - Post Class - Weird chapo!
@nuthanc
nuthanc / v2.md
Created March 15, 2022 14:48
v2 tips
V2 TIPS
in V2 each model implements a toStorage and a toJSON method.
toJSON -> transforms formdata to jsondata (used for api calls)
refer to wizardForm2Object for the corresponding controlType implementation
toStorage -> transforms jsondata to formdata (used when users edits json tab and switches to from tab)
refer to wizardObject2Form form the corresponding controlType implementation
partial implementation were managed in transformData(data-process.helpers) method which will also have to be included in the model methods for completeness.
@nuthanc
nuthanc / a.txt
Created February 24, 2022 17:31
NS
:loudspeaker: As this upcoming weekend is the Weekend Contest! :dart:
So to keep you up to speed -
The weekend contest is a major chunk of the pre-course evaluation for the students.
It is an hour-long test designed with 3 coding questions + 15 MCQ questions
Do not forget to push your mentees to take the test!
As participation is more important than winning the race :relieved:
How can you help them to be ready for the contest -
Help them out with assignments
@nuthanc
nuthanc / sample_config.yaml
Created February 4, 2022 04:52
sample_config file
k8s_clusters:
master:
kube_config_file: /Users/nuthanc/.kube/config
metadata:
dc_gw:
- vMX1
public_endpoint:
- cn2-sanity-node-1
ingress:
haproxy_nodeport: