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 zmq | |
| from django.conf import settings | |
| def send(func): | |
| context = zmq.Context() | |
| dealer = context.socket(zmq.DEALER) | |
| dealer.connect(settings.ZMQ_ROUTER_URI) |
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
| [Unit] | |
| Description=EvoStream Media Server | |
| After=network.target | |
| [Service] | |
| Type=forking | |
| ExecStart=/usr/bin/evostreamms --daemon --pid=/run/evostreamms/evostreamms.pid /etc/evostreamms/config.lua | |
| PIDFile=/run/evostreamms/evostreamms.pid | |
| User=evostreamd | |
| Group=evostreamd |
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
| from multiprocessing import Pool | |
| def cube(x): | |
| return x**3 | |
| if __name__ == '__main__': | |
| pool = Pool(processes=4) | |
| results = [pool.apply(cube, args=(x,)) for x in range(1, 7)] |
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 test(i): | |
| i += 1 | |
| def test2(i): | |
| i.append(1) | |
| a = 0 | |
| b = [] | |
| print a |
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
| # coding=UTF-8 | |
| """ | |
| “This is the “nester.py" module, and it provides one function called print_lol() which prints lists that may or | |
| may not include nested lists. | |
| """ | |
| def print_lol(the_list): | |
| """ This function takes a positional argument called “the_list", | |
| which is any Python list (of, possibly, nested lists). |
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 netifaces as nif | |
| def mac_for_ip(ip): | |
| 'Returns a list of MACs for interfaces that have given IP, returns None if not found' | |
| for i in nif.interfaces(): | |
| addrs = nif.ifaddresses(i) | |
| try: | |
| if_mac = addrs[nif.AF_LINK][0]['addr'] | |
| if_ip = addrs[nif.AF_INET][0]['addr'] | |
| except IndexError, KeyError: #ignore ifaces that dont have MAC or IP |
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 GCD(a, b): | |
| while True: | |
| if a == 0: | |
| return b | |
| elif b == 0: | |
| return a | |
| else: | |
| a, b = b, a % b |
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
| "\e[A": history-search-backward | |
| "\e[B": history-search-forward | |
| set show-all-if-ambiguous on | |
| set completion-ignore-case on |
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
| require.config({ | |
| paths: { | |
| 'bootstrap-affix': '../vendors/bootstrap/js/bootstrap-affix', | |
| 'bootstrap-alert': '../vendors/bootstrap/js/bootstrap-alert', | |
| 'bootstrap-button': '../vendors/bootstrap/js/bootstrap-button', | |
| 'bootstrap-carousel': '../vendors/bootstrap/js/bootstrap-carousel', | |
| 'bootstrap-collapse': '../vendors/bootstrap/js/bootstrap-collapse', | |
| 'bootstrap-dropdown': '../vendors/bootstrap/js/bootstrap-dropdown', | |
| 'bootstrap-modal': '../vendors/bootstrap/js/bootstrap-modal', | |
| 'bootstrap-popover': '../vendors/bootstrap/js/bootstrap-popover', |
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
| require.config({ | |
| paths: { | |
| 'jquery.effect': '../vendors/jquery-ui/jquery.effect', | |
| 'jquery.effect-blind': '../vendors/jquery-ui/jquery.effect-blind', | |
| 'jquery.effect-bounce': '../vendors/jquery-ui/jquery.effect-bounce', | |
| 'jquery.effect-clip': '../vendors/jquery-ui/jquery.effect-clip', | |
| 'jquery.effect-drop': '../vendors/jquery-ui/jquery.effect-drop', | |
| 'jquery.effect-explode': '../vendors/jquery-ui/jquery.effect-explode', | |
| 'jquery.effect-fade': '../vendors/jquery-ui/jquery.effect-fade', | |
| 'jquery.effect-fold': '../vendors/jquery-ui/jquery.effect-fold', |