Skip to content

Instantly share code, notes, and snippets.

View dumindu's full-sized avatar
🌱
One step at a time...

Dumindu Madunuwan dumindu

🌱
One step at a time...
View GitHub Profile
@dumindu
dumindu / bash
Last active March 17, 2016 00:51
screen -S dumindu
pv /home/usera/download/public/db_dump.sql.gz | gunzip | mysql db_name;
#exit from screen without terminating task
ctrl ad
#to check back
screen -r dumindu
#to terminate
ctrl d
@dumindu
dumindu / System Design.md
Created April 18, 2016 14: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?
// ------- code ----------
use std::io;
fn main() {
println!("Type someting!");
let mut input = String::new();
match io::stdin().read_line(&mut input) {
Ok(n) => println!("You input {}({} bytes)", input, n),
Err(error) => println!("error: {}", error)
@dumindu
dumindu / string to double
Last active July 10, 2016 17:15
application breaks on line16
use std::io;
fn main() {
let i_default: u64 = 4;
let d_default: f64 = 4.0;
let s_default = "HackerRank ".to_string();
let mut input = String::new();
println!("Type second integer!");
<?php
function solution($A) {
$cost = 0;
if (count($A) == 30) {
$cost += 25;
} else {
$ticketCount = [
'1d' => 0,
'7d' => 0
];
fn main() {
println!("Hello, world!");
}
/// This module contains tests
mod test {
// ...
}
mod test {
//! This module contains tests
// ...
let a = true;
let b: bool = true;
let (x, y) = (1, 2);
let mut z = 5;
z = 6;
const N: i32 = 5;
static N: i32 = 5;