Skip to content

Instantly share code, notes, and snippets.

View rchytas's full-sized avatar
🎯
Focusing

Manish Pandit rchytas

🎯
Focusing
View GitHub Profile
@rchytas
rchytas / README.md
Last active June 8, 2020 22:08
JMeter Quick Reference

JMeter Quick Reference

Samplers: Samplers tell JMeter to send a request to a server and wait for a response. Following is the list of JMeter Samplers:

FTP Request
HTTP Request
JDBC Request
Java Request
SOAP/XML-RPC Request
WebService (SOAP)
@rchytas
rchytas / README.md
Last active June 7, 2020 17:13
Top 25 Most Dangerous Software Errors

Top 25 Most Dangerous Software Errors

A list of the most dangerous programming errors and how to fix them:

List is Made by : CERT, Purdue University University of California, KRvW Associates, Information-Technology Promotion Agency (Japan), Cigital Inc., Symantec Corporation MITRE, Aspect Security, Secunia, iDefense Labs at VeriSign, Inc., MANDIANT, Microsoft, Oracle Corporation, Red Hat Inc., Fortify Software, Hatha Systems, Northern Kentucky University, ThinkSec, Veracode, Inc., Breach Security, New Access SA, (Switzerland), Missing Link Security Inc., Tata Consultancy Services (TCS), Secured Sciences Group, LLC, RSA, Apple Product Security, Software Assurance Forum for Excellence in Code (SAFECode), Core Security Technologies Inc., Depository Trust & Clearing Corporation (DTCC), National Security Agency (NSA) Information Assurance Division, Department of Homeland Security (DHS) National Cyber Security Division
@reyabreu
reyabreu / SpelUnitTest.java
Created September 11, 2019 11:00
How to unit test Spel (Spring Expression Language) expressions against standard web context
@RunWith(SpringRunner.class)
@TestPropertySource("classpath:server-test.properties")
public class SpelUnitTest {
public static final Logger logger = LoggerFactory.getLogger(Sample.class);
@Value("${testclock.start}")
private String startTime;
@Autowired

Scaling your API with rate limiters

The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.

In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.

Request rate limiter

This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.

@rchytas
rchytas / OWLToCSVRecursion.java
Last active June 23, 2023 15:47
Export an OWL ontology to a flat CSV file for people who don't know OWL
/**
* @author rchytas
*
* Use any way you like :)
*
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
@domenicomonaco
domenicomonaco / OsValidator.java
Last active August 3, 2017 14:20
OSValidator.java
/**
* Author: Domenico Monaco, Yong Mook Kim
*
* Source: https://gist.github.com/kiuz/816e24aa787c2d102dd0
*
* License: GNU v2 2014
*
* Fork / Learned: http://www.mkyong.com/java/how-to-detect-os-in-java-systemgetpropertyosname/
*
*/
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\