Skip to content

Instantly share code, notes, and snippets.

View naren-m's full-sized avatar

Naren Mudivarthy naren-m

View GitHub Profile

Cursor's Memory Bank

I am Cursor, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

Memory Bank Structure

The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:

flowchart TD
from github import Github, GithubException
def getAllReposOfOrg(org, token):
g = Github(token)
o = g.get_organization(org)
return o.get_repos()
def getFileContent(repo, filename):
try:
c = repo.get_contents(filename)
from github import Github, GithubException
def getAllReposOfOrg(org, token):
g = Github(token)
o = g.get_organization(org)
return o.get_repos()
def getFileContent(repo, filename):
try:
c = repo.get_contents(filename)
@naren-m
naren-m / github-api.go
Created February 12, 2018 05:26
Github API: Golang
// Reference:
// https://medium.com/@durgaprasadbudhwani/playing-with-github-api-with-go-github-golang-library-83e28b2ff093
package main
import (
"context"
"fmt"
"os"
@naren-m
naren-m / stream_video_using_opencv.py
Last active December 9, 2017 01:29
Stream video using OpenCv and flask
from flask import Flask, render_template, Response, jsonify, make_response
import cv2
app = Flask(__name__)
def gen():
"""Video streaming generator function."""
cap = cv2.VideoCapture(0)
@naren-m
naren-m / generate_pem.go
Created October 10, 2017 19:18
generating pem file
// Run the code and will ask for input. once you enter password it will create the pemfile
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"fmt"
"os"
@naren-m
naren-m / remove_dups.go
Created September 28, 2017 22:27
Remove duplicate in array
// https://play.golang.org/p/5NJso4_rin
package main
import (
"fmt"
)
func removeDuplicates(str *[]string) {
seen := map[string]bool{}
@naren-m
naren-m / logroate_hook.go
Created September 27, 2017 23:52
Logrus hook to logroate.
package main
import (
"os"
"time"
rotatelogs "github.com/lestrrat/go-file-rotatelogs"
"github.com/rifflock/lfshook"
log "github.com/sirupsen/logrus"
)
@naren-m
naren-m / install_go.sh
Last active May 21, 2017 16:48
Install GO 1.7 on CentOS
# Reference https://www.digitalocean.com/community/tutorials/how-to-install-go-1-7-on-centos-7
cd /tmp
curl -LO https://storage.googleapis.com/golang/go1.7.linux-amd64.tar.gz
shasum -a 256 go1.7*.tar.gz
sudo tar -C /usr/local -xvzf go1.7.linux-amd64.tar.gz
export PATH=/usr/local/go/bin:$PATH
export GOPATH=/root/go
mkdir -p $GOPATH/{bin,pkg,src}
@naren-m
naren-m / watchdog_example.py
Last active April 8, 2017 01:23
Looking for changes in directory
# pip install watchdog
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from subprocess import call
class DirChangeHandler(FileSystemEventHandler):
def on_modified(self, event):