This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beautifulsoup4==4.3.2 | |
requests==2.3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def retry(exception): | |
def retry_decorator(func): | |
def _wrapper(*args, **kwargs): | |
tries = 0 | |
while True: | |
try: | |
return func(*args, **kwargs) | |
except exception as error: | |
tries += 1 | |
if tries <= 5: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gitfs_remotes: | |
- https://github.com/saltstack-formulas/nginx-formula.git | |
- https://github.com/saltstack-formulas/apache-formula.git | |
- https://github.com/saltstack-formulas/mysql-formula.git | |
- https://github.com/saltstack-formulas/vim-formula.git | |
- https://github.com/saltstack-formulas/build-essential-formula.git | |
- https://github.com/saltstack-formulas/pip-formula.git | |
fileserver_backend: | |
- git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import random | |
import math | |
def map_d(c): | |
return math.hypot(random.random(), random.random()) | |
def reduce_d(count_inside, d): | |
if d < 1: | |
return count_inside + 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function LessToCss() | |
let current_file = shellescape(expand('%:p')) | |
let filename = shellescape(expand('%:r')) | |
let command = "silent !lessc " . current_file . " " . filename . ".css" | |
echo 'less compilation finished' | |
execute command | |
endfunction | |
autocmd BufWritePost,FileWritePost *.less call LessToCss() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
String Calculator | |
1- The program can take 0, 1 or 2 numbers and will | |
return their sum, (for an empty string it will return 0) | |
for example "" or "1" or "1,2" -> 0, 1, 3 | |
2- Allow the Add method to handle an unknown amount | |
of numbers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fizzbuzz(number) | |
if number == 0 | |
return '0' | |
elsif number % 15 == 0 | |
return 'fizzbuzz' | |
elsif number % 3 == 0: | |
return 'fizz' | |
elsif number % 5 == 0: | |
return 'buzz' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fizzbuzz(number){ | |
if(number === 0){ | |
return '0'; | |
} | |
if(number % 3 === 0 && number % 5 === 0){ | |
return 'fizzbuzz'; | |
} | |
if(number % 3 === 0){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class FizzBuzz | |
{ | |
static public function categorize($num) { | |
$result = ''; | |
if($num === 0){ | |
return '0'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fizzbuzz(num): | |
if num == 0: | |
return '0' | |
if num % 3 == num % 5 == 0: | |
return 'fizzbuzz' | |
if num % 3 == 0: | |
return 'fizz' |