Skip to content

Instantly share code, notes, and snippets.

View Subb98's full-sized avatar
🔧

Vladislav Subbotin Subb98

🔧
View GitHub Profile
@vasanthk
vasanthk / System Design.md
Last active October 22, 2025 09:01
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
<?php
/**
* Saves remote image using Curl request
* @param string $img URL from which image is to be retrieved
* @param string $fullpath Full path to the image
* @param string $imageVerify Fullpath where image will be saved.
* @see http://stackoverflow.com/questions/10890617/grabbing-image-with-curl-php
*/
function saveImage($img, $fullpath = null, $imageVerify = true) {
@awesome
awesome / strip HTML tags
Created November 3, 2009 16:29
ruby strip HTML tags
# copied from (thanks!): http://codesnippets.joyent.com/posts/show/615
str = <<HTML_TEXT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<h1>Application error</h1>
<p>Change this error message for exceptions thrown outside of an action (like
in Dispatcher setups or broken Ruby code) in public/500.html</p>