Skip to content

Instantly share code, notes, and snippets.

View randsina's full-sized avatar

Roman Vakulchik randsina

  • Studytube
  • Amsterdam, Netherlands
View GitHub Profile
@randsina
randsina / .bashrc
Created February 22, 2015 20:16
Prompt for bash
ESC="\033" # This is the escape sequence
NO_COLOR="$ESC[0m"
IRED="$ESC[1;31m" # ANSI color code for intense/bold red
IGRN="$ESC[1;32m" # ANSI color code for intense/bold green
# From http://railstips.org/blog/archives/2009/02/02/bedazzle-your-bash-prompt-with-git-info/
# I had to change 'git-symbolic-ref' to 'git symbolic-ref'
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo " ["${ref#refs/heads/}"]" # I wanted my branch wrapped in [], use () or <> or whatever
@randsina
randsina / 1.rb
Created March 31, 2015 00:22
lab for math analysis
require 'matrix'
matrix_A = [[3, 2, 1], [-2, 3, -2], [1, -4, 4]]
vector_B = [-1, 1, 6]
p matrix_A
p vector_B
1.upto(matrix_A.size - 1) do |index|
current_element = matrix_A[index - 1][index - 1]
@randsina
randsina / gist:73e844ff9fdd7a9cc061
Created April 14, 2015 19:34
Computer networks
https://github.com/iu7-2014/Lectures.Semester-7/blob/master/%D0%9A%D0%BE%D0%BC%D0%BF%D1%8C%D1%8E%D1%82%D0%B5%D1%80%D0%BD%D1%8B%D0%B5%20%D1%81%D0%B5%D1%82%D0%B8.%20%D0%9B%D0%B5%D0%BA%D1%86%D0%B8%D0%B8.md
@randsina
randsina / bootsrap_class_list
Created February 8, 2016 08:37 — forked from geksilla/bootsrap_class_list
Bootstrap css class list
.navbar
.caret
.label
.table
.img-responsive
.img-rounded
.img-thumbnail
.img-circle
.sr-only
.lead
@randsina
randsina / ml-ruby.md
Created May 14, 2016 10:01 — forked from gbuesing/ml-ruby.md
Resources for Machine Learning in Ruby

Resources for Machine Learning in Ruby

Gems

class AdminMessagesController < ApplicationController
before_action :authenticate_user!, only: [:create]
def create
@admin_message = current_user.admin_messages.new(message_params)
respond_to do |format|
if @admin_message.save
AdminMailer.new_message(email_params).deliver_later
@admin_message = AdminMessage.new
# == Schema Information
#
# Table name: exchanges
#
# id :integer not null, primary key
# user_id :integer
# extra_payment_to_give :decimal(10, 2)
# extra_payment_to_receive :decimal(10, 2)
# is_active :boolean default(FALSE)
# ready_to_moderate :boolean default(FALSE)
.wrapper
.cruise-experts-brochure{ role: "main" }
.container(ng-controller="BrochureCtrl")
.search-area
%h3= @widget.look_feel['header_text']
%form#search
%input(type="text" placeholder="#{@widget.look_feel['search_box_placeholder_text']}" ng-model="criteria")
%button(type="submit")
%i.fa.fa-search.fa-2
.brochures
rvakulchik-s551lb
description: Notebook
product: S551LB (ASUS-Ultrabook)
vendor: ASUSTeK COMPUTER INC.
version: 1.0
serial: E1N0CX118687050
width: 64 bits
capabilities: smbios-2.7 dmi-2.7 smp vsyscall32
configuration: boot=normal chassis=notebook family=S sku=ASUS-Ultrabook uuid=11000000-0000-0000-0000-E03F49CC5E70
*-core
module AdEngine
module Elasticsearch
module Updater
class ImporterEs
CORE_COUNT = 2
DEGREE_OF_PARALLELISM = 32
BATCH_SIZE = 256
def reset!(suffix = Time.zone.now.to_i)
indexes = TestDataIndex.indexes