Skip to content

Instantly share code, notes, and snippets.

View bDrwx's full-sized avatar

Andrew Bodosov bDrwx

View GitHub Profile
@bDrwx
bDrwx / ubuntu_agnoster_install.md
Created July 10, 2019 10:12 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@bDrwx
bDrwx / pig-latin
Created February 16, 2019 19:51 — forked from DenialAdams/pig-latin
A small program that takes a word (String) as input and translates it into Pig Latin
use std::io;
fn main() {
let mut input = String::new();
loop {
io::stdin().read_line(&mut input)
.expect("Failed to read line");
input = input.trim().to_string();
piglatinize(&mut input);
println!("{}", input);
@bDrwx
bDrwx / playground.rs
Created February 16, 2019 15:25 — forked from rust-play/playground.rs
Code shared from the Rust Playground
#![allow(unused)]
use std::collections::HashMap;
fn main() {
let mut vec = vec![3, 5, 6, 3, 4, 7, 4];
println!("Averege ={}", averege(&vec));
assert_eq!(median(&mut vec), 4.0);
println!("Median ={}", median(&mut vec));
println!("Mode ={}", mode(&vec));
}
fn averege(v: &[i32]) -> f32 {
@bDrwx
bDrwx / mysql_backup.sh
Created March 11, 2018 08:57 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@bDrwx
bDrwx / test.rb
Last active February 12, 2018 20:54 — forked from Mehonoshin/test.rb
Тестовое задание №1
# В целом создание корзины магазина неплохо описано в Agile web development
# with Rails. Думаю что концепция CRUID для данного типа приложений выглядит
# более естественно. Так же хорошо вписывается в данную модель создание промежуточной
# сущности между item между корзиой и списком товаров.
# В цело данный метод слишком веоик, не интуитивен и смешивает в кучу все слои MVC.
class BasketController
def add_to_basket
# Предпочтительно оперировать понятием уникального идентификатора id
item = Item.find_by_title(params[:item_title])
@bDrwx
bDrwx / services
Created December 7, 2017 18:55 — forked from mlen/services
#
# Network services, Internet style
#
# Note that it is presently the policy of IANA to assign a single well-known
# port number for both TCP and UDP; hence, most entries here have two entries
# even if the protocol doesn't support UDP operations.
#
# The latest IANA port assignments can be gotten from
#
# http://www.iana.org/assignments/port-numbers
@bDrwx
bDrwx / services
Created December 7, 2017 18:55 — forked from mlen/services
#
# Network services, Internet style
#
# Note that it is presently the policy of IANA to assign a single well-known
# port number for both TCP and UDP; hence, most entries here have two entries
# even if the protocol doesn't support UDP operations.
#
# The latest IANA port assignments can be gotten from
#
# http://www.iana.org/assignments/port-numbers
@bDrwx
bDrwx / introrx.md
Created December 18, 2016 08:06 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@bDrwx
bDrwx / gulpfile.js
Created October 6, 2015 19:53 — forked from ktmud/gulpfile.js
An example gulpfile.js with bower components and live reload support
var BatchStream = require('batch-stream2')
var gulp = require('gulp')
var coffee = require('gulp-coffee')
var uglify = require('gulp-uglify')
var cssmin = require('gulp-minify-css')
var bower = require('gulp-bower-files')
var stylus = require('gulp-stylus')
var livereload = require('gulp-livereload')
var include = require('gulp-include')
var concat = require('gulp-concat')
@bDrwx
bDrwx / 0_reuse_code.js
Last active September 16, 2015 10:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console