Skip to content

Instantly share code, notes, and snippets.

View missingdays's full-sized avatar
🎯
Focusing

Evgeny Bovykin missingdays

🎯
Focusing
View GitHub Profile
@missingdays
missingdays / recursion.cpp
Created July 13, 2016 12:56
Recursion example
int factorial_recursion(int n){
if(n < 2){
return 2;
}
return n * factorial_recursion(n-1)
}
int factorial(int n){
int m = 1;
@missingdays
missingdays / anagram.js
Last active January 21, 2016 11:24
Such anagram
function addLetters(s){
var letters = {};
for(var i = 0; i < s.length; i++){
var letter = s[i].toLowerCase();
if(letter != " "){
if(letters[letter]){
letters[letter] += 1;
} else {
@missingdays
missingdays / Some music
Created January 9, 2016 09:25
codegolf.sh
echo "g(i,x,t,o){return((3&x&(i*((3&i>>16?\"BY}6YB6%\":\"Qj}6jQ6%\")[t%8]+51)>>o))<<4);};main(i,n,s){for(i=0;;i++)putchar(g(i,1,n=i>>14,12)+g(i,s=i>>17,n^i>>13,10)+g(i,s/3,n+((i>>11)%3),10)+g(i,s/5,8+n-((i>>10)%3),9));}"|gcc -xc -&&./a.out|aplay
def formula_1(x):
# Вычисление первой формулы
n = x
return n
def formula_2(a, b, y):
# Вычисление второй формулы
n = a + b + y
return n
function a(){
var b = 5;
return {
setB: function(n){
b = n;
},
getB: function(){
return b
}
};
function a(j){
console.log(j);
}
for(var i = 0; i < 5; i++){
a(i);
}
@missingdays
missingdays / file.c
Last active October 7, 2015 16:26
Return static
#include <stdio.h>
int* a(){
static int b = 5;
return &b;
}
int main(){
int *b = a();
@missingdays
missingdays / pie-explode.js
Last active August 29, 2015 14:27 — forked from miguelmota/pie-explode.js
d3.js explode pie chart
function explode(d, index) {
var offset = 10;
var angle = (d.startAngle + d.endAngle) / 2;
var xOff = Math.sin(angle) * offset;
var yOff = -Math.cos(angle) * offset;
return 'translate(' + xOff + ',' + yOff +')';
}
arc.attr('transform', explode);
@missingdays
missingdays / .vimrc
Last active July 13, 2016 15:35
my .vimrc
call plug#begin('~/.config/nvim/plugged')
Plug 'https://github.com/flazz/vim-colorschemes'
Plug 'https://github.com/scrooloose/nerdtree'
Plug 'https://github.com/moll/vim-node'
Plug 'https://github.com/pangloss/vim-javascript'
Plug 'https://github.com/jelera/vim-javascript-syntax'
call plug#end()
set ruler
set laststatus=2
a = 3
for i in range(1):
a = 4
print(a) #4
for j in range(1):
a = 5
print(a) #5
print(a) #5
print(a) #5