Skip to content

Instantly share code, notes, and snippets.

View banerRana's full-sized avatar

Rana Banerjee banerRana

  • Automated It Solutions
  • Washington, DC
View GitHub Profile
@itzmeanjan
itzmeanjan / test_montgomery_arithmetic.py
Last active October 22, 2024 05:08
Montgomery Modular Arithmetic for 256 -bit `secp256k1` Prime Field
#!/usr/bin/python3
from math import ceil
from typing import List, Tuple
from random import randint
def bit_count(num: int) -> int:
'''
Same as len(bin(num)[2:])
@rouxcaesar
rouxcaesar / bradfield-thoughts.md
Last active December 15, 2024 16:04
Thoughts on Bradfield

My Thoughts on Bradfield

I've been asked by several people over time about my experience with the classes offered by Bradfield, and thought that I should save some future keystrokes by writing up a short gist for future reference. Hopefully this gist will be useful for others who are considering Bradfield and wondering it is worth it. My intended audience is primarily Launch School students who have completed the Core program and likely also Capstone, but the majority of this gist will be applicable to anyone who is a working/experienced software engineer.

Since late 2019, I've taken 4 short courses from the Bradfield School of Computer Science and in 2021 I enrolled in their Computer Science Intensive (CSI) program1. Overall, I've found the courses and CSI to be an excellent opportunity to grown my technical skills and broaden my knowledge of CS topics.

The courses I completed were:

  • Computer Architecture: The Hardware/Software Interface
opt.<Runnable>map(value -> () -> System.out.println("Found " + value))
.orElse(() -> System.out.println("Not present!"))
.run();
Optionals.ifPresentOrElse(opt, System.out::println,
() -> System.out.println("not present"));
@zivce
zivce / ifNotPresent_WrongApproach.java
Last active February 17, 2022 14:16
How to not create ifNotPresent in Java
Optional.of(opt).map(value -> { System.out.println(value);
return value; })
.orElseGet(() -> { System.out.println("not present");
return -1;});
@atomkirk
atomkirk / stop-all-docker.md
Created February 9, 2021 14:25
Stop all Docker containers

I will often run this command to make sure all my docker containers are stopped and removed before running docker-compose up. Sometimes when you restart your system, old containers will start back up automatically in the background.

docker stop $(docker ps -aq) && docker rm $(docker ps -aq)
@wwerner
wwerner / docker-tomcat_remote-debugging.adoc
Last active June 3, 2021 18:16
Set up remote debugging for Tomcat in Docker

Set up remote debugging in dockerized Tomcat

Start Container, stock tomcat 8.5 in this example
$  docker run \
    -eJPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" \
    -p8080:8080 \
// Primitive hash function that for a string returns a positive 32 bit int
// Do not use in production, use murmur3 or fnv1
// You can improve this by changing 5 to 31
Object.defineProperty(String.prototype, 'hashCode', {
value: function() {
var hash = 0, i, chr;
for (i = 0; i < this.length; i++) {
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
@johnpmitsch
johnpmitsch / a.md
Last active June 25, 2024 17:10
Bradfield CS Distributed Systems

Distributed Systems

Lesson 1 - Introduction

  • Systems today are generally distributed, both in-house and third-party systems
  • Stream processing is batch processing but in smaller increments, it isn't real-time, but is quick
  • Project, work as pre and post work
  • Reliability
  • Scalability
  • Maintainability
@bennadel
bennadel / test.cfm
Created April 28, 2020 11:35
Creating A Partially-Transparent Overlay Using GraphicsMagick And Lucee CFML 5.2.9.31
<cfscript>
startedAt = getTickCount();
inputFilepath = expandPath( "../images/beach-small.jpg" );
// In the first approach to drawing a partially-transparent image over another, we're
// going to create an intermediary image that represents the image overlay. This will
// the SCALED and PARTIALLY-TRANSPARENT image.
// --