Skip to content

Instantly share code, notes, and snippets.

View ExReanimator's full-sized avatar

Ivan Schneider ExReanimator

  • HCM4all gmbh
  • Augsburg, Bavaria, Germany
View GitHub Profile
import time
def light_on_and_off(pin_to_on, pin_to_off):
print str(pin_to_on) + " is ON"
print str(pin_to_off) + " is OFF"
time.sleep (0.5)
pins = ["PIN1", "PIN2", "PIN3", "PIN4", "PIN5", "PIN6"]
for i in range(6):
import random
def inOut(x, y):
if x + y <= 1:
return True
else:
return False
def calc_pi(n):
return 4/n
def displayMenu():
print('\n\n Main menu of calculator:')
print('1) add to numbers')
print('2) substract to numbers')
print('3) multiply to numbers')
print('4) divide to numbers')
print('5) potentize to numbers')
print('6) exit program')
print('7) factorial')
print('8) binomial coefficient')
@ExReanimator
ExReanimator / imagemagick_problem.sh
Last active February 2, 2019 12:46
Can't install RMagick 2.16.0. Can't find MagickWand.h
$ brew tap homebrew/versions
$ brew install imagemagick@6
$ PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem install rmagick
$ /opt/sdb/programs/bin/x_start AFDB
# если говорит, что x server down, то
$ /opt/sdb/programs/bin/x_server start
@ExReanimator
ExReanimator / fibonacci.rb
Created June 25, 2015 20:58
My solution for Fibonacci task
fibonacci = -> (i, x = 0, y = x + 1) do
if i > 0
puts x
fibonacci.call(i-1, y, x + y)
end
end
# calculate 10 times
fibonacci.call(10)