Skip to content

Instantly share code, notes, and snippets.

View vivanov1410's full-sized avatar
๐Ÿ˜Ž
fighting back-to-back with kids

Viatcheslav Ivanov vivanov1410

๐Ÿ˜Ž
fighting back-to-back with kids
View GitHub Profile
@vivanov1410
vivanov1410 / diagram.js
Created July 1, 2015 22:39
Diagram for connio website
(function () {
'use strict';
var app = this.app || (this.app = {});
app.Diagram = (function () {
function Diagram() {
this.started = false;
this._nodes = {
top: {
alias gd="git diff | mate"
alias ga="git add"
alias gbd="git branch -D"
alias gst="git status"
alias gca="git commit -a -m"
alias gm="git merge --no-ff"
alias gpt="git push --tags"
alias gp="git push"
alias grh="git reset --hard"
alias gb="git branch"
@vivanov1410
vivanov1410 / humans.txt
Created July 27, 2013 22:57
Our default humans.txt
/* TEAM */
Engineer: Viacheslav (Slava) Ivanov
Contact: slava [at] exilium.ca
Twitter: @vivanov1410
From: Vancouver, BC, Canada
Designer: Svetlana Ivanova
Contact: sveta [at] exilium.ca
Twitter: @siya0509
@vivanov1410
vivanov1410 / prize.c
Created May 16, 2013 03:27
prize and 3 doors riddle
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define NUMBER_OF_GAMES 1000
#define NUMBER_OF_CHOICES 3
int main(int argc, char const *argv[]) {
int arr[NUMBER_OF_GAMES][NUMBER_OF_CHOICES] = {0};
@vivanov1410
vivanov1410 / tasuku3.c
Created May 9, 2013 00:36
Solution for tasuku 3 Fiby
// tasuku3.c
#include <stdio.h>
#define MAX_LIMIT 4000000
int main(int argc, char const *argv[]) {
// counter for basic operations
int counter = 0;
@vivanov1410
vivanov1410 / gist:5521924
Created May 5, 2013 19:37
Tasuku 2. Create a method that display all possible permutations in a string
<?php
# basic operation counter
$count = 0;
# prints all n! permutations of $str, $start - start index, $len - string length
function permute($str, $start, $len) {
if($start == $len) {
print "$str\n" . "<br/>";
return;
@vivanov1410
vivanov1410 / gist:5457539
Last active December 16, 2015 15:39
solution for tasuku1: "If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000". answer: 234168, total basic operations = 21
a = 3
b = 5
c = 1000
sum = 0
counter = 0
function foo()
sum = 0
for i = a,c-1 do
@vivanov1410
vivanov1410 / .bash_profile
Created December 6, 2012 08:30
bash settings
COL_BLACK=$'\[\033[30m\]'
COL_RED=$'\[\033[31m\]'
COL_GREEN='\[\033[32m\]'
COL_YELLOW_ORANGE=$'\[\033[33m\]'
COL_BLUE=$'\[\033[34m\]'
COL_MAGENTA=$'\[\033[35m\]'
COL_CYAN=$'\[\033[36m\]'
COL_NORM=$'\[\033[39m\]'
PMPT_BOLD=$'\[\033[1m\]'
PMPT_NORM=$'\[\033[0m\]'
prime_sieve = (n) ->
primes = []
numbers = []
numbers[number] = true for number in [2..n]
l = Math.floor Math.sqrt n
main_index = 2
@vivanov1410
vivanov1410 / gist:3263832
Created August 5, 2012 10:42
Star Sky (or Snow...)
<!DOCTYPE HTML>
<html>
<head>
<style>
body {
margin: 0px;
padding: 0px;
}
canvas {
border: dotted 3px black;