Skip to content

Instantly share code, notes, and snippets.

View gserb's full-sized avatar

George Serbanescu gserb

View GitHub Profile
@gserb
gserb / web-servers.md
Created May 13, 2021 14:03 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
function Article(props) {
return (
<Container img={props.image}>
<div className="imageContainer">
<div className="image"></div>
</div>
<div className="description">
<p className="title">{props.title}</p>
<span>{props.meta}</span>
</div>
@gserb
gserb / article.js
Last active July 19, 2020 12:23
Article React component - card with title, description and image
import React from 'react';
import styled from 'styled-components';
const Container = styled.div`
display: flex;
align-items: flex-start;
padding: 8px;
border-radius: 4px;
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
@gserb
gserb / padStart_polyfill.js
Last active June 21, 2019 07:51
padStart polyfill
if (!String.prototype.padStart) {
String.prototype.padStart = function (n,str){
return Array(n-String(this).length+1).join(str||'0')+this;
}
}
@gserb
gserb / System Design.md
Created April 20, 2016 05:42 — forked from vasanthk/System Design.md
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?
@gserb
gserb / AFINN-111 RO
Last active August 29, 2015 14:23
AFINN-111 Dataset adapted for RO language -- sentiment analyses
{"abandoneze" : -2,
"abandonat" : -2,
"abandoneaza" : -2,
"rapit" : -2,
"rapire" : -2,
"rapiri" : -2,
"detesta" : -3,
"detestat" : -3,
"odioase" : -3,
"uraste" : -3,
@gserb
gserb / Distributed systems fundamentals.js
Last active August 29, 2015 14:14
It's a collection of documentations from wikipedia about distributed systems concepts
'ACID (Atomicity, Consistency, Isolation, and Durability)'
0 Atomicity: Either the task (or all tasks) within a transaction are performed or none of them are. This is the all-or-none principle. If one element of a transaction fails the entire transaction fails.
0 Consistency: The transaction must meet all protocols or rules defined by the system at all times. The transaction does not violate those protocols and the database must remain in a consistent state at the beginning and end of a transaction; there are never any half-completed transactions.
0 Isolation: No transaction has access to any other transaction that is in an intermediate or unfinished state. Thus, each transaction is independent unto itself. This is required for both performance and consistency of transactions within a database.
0 Durability: Once the transaction is complete, it will persist as complete and cannot be undone; it will survive system failure, power loss and other types of system breakdowns.
___________________________
@gserb
gserb / SectiiVotare.json
Last active August 29, 2015 14:06
Contine toate localitatile din Romania cu urmatoarele atribute: Localitate, Judet, Longitudine, Latitudine, Sectii de votare. Datele sunt extrase si parsate din http://data.gov.ro/dataset/alegeri-prezidentiale-2009. Sectiile de votare din strainatate au 'Judet: Strainante', pentru a obtine o lista doar cu entitatile din Romania, excludetile pe a…
[{Localitate:"MUNICIPIUL BLAJ",Judet:"Alba",Latitudine:23.92261,Longitudine:46.17461,Sectii:["Strada Garii (Piata Mica Agroalimentara) - Sala administratie piata","Strada Iuliu Maniu, nr. 101 (sediul SC APA CTTA) - Sala nr. 1 Tel:258711340","Gradinita de copii cu program prelungit nr. 3, Strada Eroilor, nr. 22 - Sala 1 Tel:258712838","Scoala Generala nr. 1, B-dul Republicii, nr.48 - Cancelarie - Sala nr. 1 Tel:258711933","Casa de Cultura a municipiului Blaj, B-dul Republicii, nr. 36 - Holul Casei de Cultura Tel:258711020","Grupul Scolar Agricol, Piata 1848, nr. 3 - Sala nr. 40 Tel:258710655",'Universitatea "Spiru Haret" Blaj, str. Tudor Vladimirescu, nr. 80 (fostul sediu Agromec Blaj), sala nr 1 Tel:258711231',"Piata Mare Agroalimentara - Sala administratie piata Tel:Nu dispune","AJVPS Blaj (fostul CET Blaj), str. George Baritiu, nr. 5 - Sala nr. 1 Tel:Nu dispune","Grupul Scolar pentru Industrializarea lemnului Blaj, strada dr. Vasile Suciu, nr. 29 - Sala nr 4 Tel:258713630",'Colegiul National "I.I. Micu Clai