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
| syntax on " 1 | |
| set t_Co=256 " 1a | |
| "" Colours for syntax highlighting (2) | |
| " (a) If 256 colors not supported | |
| hi Comment ctermfg=DarkGreen | |
| hi Constant ctermfg=Magenta | |
| " (b) If 256 colors supported |
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
| # If you use the GNU debugger gdb to debug the Python C runtime, you | |
| # might find some of the following commands useful. Copy this to your | |
| # ~/.gdbinit file and it'll get loaded into gdb automatically when you | |
| # start it up. Then, at the gdb prompt you can do things like: | |
| # | |
| # (gdb) pyo apyobjectptr | |
| # <module 'foobar' (built-in)> | |
| # refcounts: 1 | |
| # address : 84a7a2c | |
| # $1 = void |
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
| !#/usr/bin/env python | |
| import requests | |
| import time | |
| from Foundation import NSUserNotification | |
| from Foundation import NSUserNotificationCenter | |
| from Foundation import NSUserNotificationDefaultSoundName | |
| URL = 'https://polandonline.vfsglobal.com/poland-ukraine-appointment/(S(vvzibb45kxnimzfrnhuavib1))/AppScheduling/AppWelcome.aspx?P=s2x6znRcBRv7WQQK7h4MTjZiPRbOsXKqJzddYBh3qCA=' | |
| HEADERS = {'Host': 'polandonline.vfsglobal.com'} |
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
| str1 = 'x' * 10 | |
| str2 = 'x' * 10 | |
| str1 is str2 # Gives 'True' | |
| # Now let's increase object's size a bit | |
| str1 = 'x' * 100 | |
| str2 = 'x' * 100 | |
| str1 is str2 # Gives 'False', WTF? | |
| # Python tries to cache everything up to specific size, that's why in the first example |
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
| class A(): | |
| def first(self): | |
| print("Class A") | |
| class B(A): | |
| pass | |
| class C(A): | |
| def first(self): | |
| print("Class C") |
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
| #!/usr/bin/env python | |
| import unittest | |
| import time | |
| import netinfo | |
| import threading | |
| from scapy.all import send, sniff, conf, IP, TCP | |
| UNIQUE_MESSAGE = 'Errors should never pass silently' | |
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
| { | |
| "auto_complete": false, | |
| "caret_style": "blink", | |
| "color_scheme": "Packages/Material Theme/schemes/Material-Theme-OceanicNext.tmTheme", | |
| "draw_white_space": "all", | |
| "ensure_newline_at_eof_on_save": true, | |
| "default_line_ending": "system", | |
| "find_selected_text": true, | |
| "fold_buttons": false, | |
| "highlight_line": true, |
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: cp1251 -*- | |
| import httplib2 | |
| import MySQLdb as mdb | |
| from BeautifulSoup import BeautifulSoup, SoupStrainer | |
| STEP = 25 | |
| MAX_COUNTER = 3925 | |
| def import_links(): | |
| """Method for scrapping images links for http://www.yaplakal.com |
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
| #!/usr/bin/env python | |
| import urllib | |
| import urllib2 | |
| import re | |
| import os | |
| __author__ = 'Nazarii Gudzovatyi <counter.sparta@gmail.com>' | |
| __description = """Simple script for downloading all podcasts | |
| from The art of programming (http://taop.rpod.ru/) site. |
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 dateutil import rrule | |
| from datetime import datetime | |
| def get_schedule_holidays_rrules(): | |
| return [ | |
| rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=1, bymonthday=1), # New Years | |
| rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=5, byweekday=rrule.MO(-1)), # Memorial | |
| rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=7, bymonthday=4), # Independence | |
| rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=11, byweekday=rrule.TH(4)), # Thanksgiving | |
| rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=12, bymonthday=25), # Christmas |
NewerOlder