Skip to content

Instantly share code, notes, and snippets.

View maksadbek's full-sized avatar
💭
Chilling

Maksadbek maksadbek

💭
Chilling
View GitHub Profile
@maksadbek
maksadbek / System Design.md
Created April 18, 2016 11:43 — 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?
@maksadbek
maksadbek / mgoExample.go
Created March 15, 2016 17:20 — forked from border/mgoExample.go
mgo example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
@maksadbek
maksadbek / Ruby_finance_testcase.md
Created April 24, 2016 17:27 — forked from beshkenadze/Ruby_finance_testcase.md
Тестовое задание для Ruby-разработчика

Задание

Реализовать на Ruby с использованием Rails приложение со следующим функционалом:

  1. Регистрация / авторизация пользователей.
  2. Создание портфеля акций (5-6 акций достаточно) для пользователя: стандартный CRUD.
  3. Данные должны скачиваться с Yahoo Finance.
  4. Сделать вывод графика "стоимость портфеля от времени" за 2 последних года по выбранным в п.2 акциям.

Требования

@maksadbek
maksadbek / gist:f9f4cb120da991b5634b966c29748d25
Created May 8, 2016 14:51 — forked from rygorous/gist:e0f055bfb74e3d5f0af20690759de5a7
A bit of background on compilers exploiting signed overflow
Why do compilers even bother with exploiting undefinedness signed overflow? And what are those
mysterious cases where it helps?
A lot of people (myself included) are against transforms that aggressively exploit undefined behavior, but
I think it's useful to know what compiler writers are accomplishing by this.
TL;DR: C doesn't work very well if int!=register width, but (for backwards compat) int is 32-bit on all
major 64-bit targets, and this causes quite hairy problems for code generation and optimization in some
fairly common cases. The signed overflow UB exploitation is an attempt to work around this.
@maksadbek
maksadbek / badmail.Rmd
Created March 3, 2016 14:28 — forked from hrbrmstr/badmail.Rmd
Code for this post:
---
title: "Visualizing the Clinton Email Network in R"
author: "hrbrmstr"
date: "`r Sys.Date()`"
output: html_document
---
```{r include=FALSE}
knitr::opts_chunk$set(
collapse=TRUE,
comment="#>",
@maksadbek
maksadbek / slim-redux.js
Created March 7, 2016 16:41 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@maksadbek
maksadbek / rmongodb-tutorial.md
Created February 24, 2016 15:03 — forked from Btibert3/rmongodb-tutorial.md
Basic Overview of using the rmongodb package for R.

rmongodb Tutorial

This is a quick document aimed at highlighting the basics of what you might want to do using MongoDB and R. I am coming at this, almost completely, from a SQL mindset.

Install

The easiest way to install, I believe, is

@maksadbek
maksadbek / springer-free-maths-books.md
Created December 28, 2015 20:20 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@maksadbek
maksadbek / Kruskal_MST.cpp
Created November 4, 2015 08:52 — forked from calmhandtitan/Kruskal_MST.cpp
C++ implementation of Kruskal's Algorithm for finding the MST using Union-Find Data Structure
//Kruskal using Union_Find
#include "stdio.h"
#include "string.h"
#include "vector"
#include "algorithm"
using namespace std;
#define pii pair<int, int>
#define pip pair<int, pii>
#define F first