Skip to content

Instantly share code, notes, and snippets.

View nvinayvarma189's full-sized avatar

Vinay Varma nvinayvarma189

View GitHub Profile

I want to solve the following problem, but I’m stuck.
Please act as a “cognitive centrifuge.”

  1. Break the problem into exactly four numbered sub-problems.
  2. For each sub-problem, give me one concrete micro-action I can do in under 2 minutes that will either (a) make the problem smaller, or (b) give me new information.
  3. After the four micro-actions, add a one-line “momentum booster” I can say out loud to prime my brain to keep going.
  4. Format the whole thing so I can read it in <15 seconds.

Problem:

@matthen
matthen / hello_world.py
Last active November 25, 2024 21:51
Hello world in python, using genetic algorithm
"""Hello world, with a genetic algorithm.
https://twitter.com/matthen2/status/1769368467067621791
"""
import random
import time
from dataclasses import dataclass
from itertools import chain
from typing import Iterable, List
@ujjwalll
ujjwalll / GSoC_Final_Submission.md
Last active September 2, 2020 16:30
Final Submission Report for GSoC project "OpenDevoCell Integration".
@skfarhat
skfarhat / VSCode Internal Commands
Created May 19, 2020 21:22
List of VSCode commands
--------------------------------------------
Version: 1.45.1
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:33:47.663Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 18.5.0
-------------------------------------------
@tomcant
tomcant / configure-s3-lambda-notification.sh
Last active October 8, 2024 14:42
Configure S3 Lambda notifications
#!/usr/bin/env bash
##
# This configures an S3 bucket ObjectCreated notification for the given Lambda
# function so that when a file is uploaded the Lambda function is invoked. This
# is useful when the bucket is not defined in the same CloudFormation template
# as the function. CloudFormation cannot setup the notification in this case.
#
# Note that the AWS CLI is used and will require valid AWS credentials for the
# account containing the resources. The 'jq' JSON processor is also required
@sjakthol
sjakthol / s3_list_objects_parallel.py
Created January 11, 2019 20:20
Python code snippet for listing bucket objects in parallel.
#!/usr/bin/env python3
"""List S3 bucket objects in parallel.
This module contains a parallel implementation of S3 list_objects_v2()
API call. The implementation lists objects under every distinct prefix
in parallel. Hence, a speedup is achieved if objects are spread under
multiple distinct prefixes.
"""
import argparse
@felipessalvatore
felipessalvatore / gradient_descent.py
Last active July 6, 2022 05:35
Plotting a 3d image of gradient descent in Python
#code adapted from http://tillbergmann.com/blog/python-gradient-descent.html
%matplotlib inline
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from scipy import stats
from sklearn.datasets.samples_generator import make_regression
@ankurk91
ankurk91 / github_gpg_key.md
Last active August 6, 2025 12:14
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@jayapal
jayapal / get_color_code.py
Created May 27, 2016 07:37
get_color_code.py
from sklearn.cluster import KMeans
from sklearn import metrics
import cv2
# By Adrian Rosebrock
import numpy as np
import cv2
# Load the image
image = cv2.imread("red.png")
@klausbayrhammer
klausbayrhammer / cherry pick to multiple branches
Created October 10, 2014 12:52
cherry-pick a commit to multiple branches
#!/bin/bash
function merge {
git pull --rebase
git cherry-pick -x $1
git status
echo "Commit? (y/n):"
read XN