⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains 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 | |
""" | |
Parse a HAR (HTTP Archive) and return URLs which do not match specific domain | |
HAR Spec: http://groups.google.com/group/http-archive-specification/web/har-1-2-spec | |
HAR can be saved, for example, from Chrome Developer Tools | |
Copyleft 2012 Andrei Kost <kost@kost.ru> | |
based Ian Gallagher <crash@neg9.org> script https://gist.github.com/892479 | |
Example usage: ./har_request_urls.py foo.har | |
""" |
This file contains 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 ($cat == $cat1 || $parent == $cat1) $class = 'cat1'; | |
if ($cat == $cat2 || $parent == $cat2) $class = 'cat2'; | |
if ($cat == $cat3 || $parent == $cat3) $class = 'cat3'; | |
if ($cat == $cat4 || $parent == $cat4) $class = 'cat4'; | |
if ($cat == $cat5 || $parent == $cat5) $class = 'cat5'; | |
if ($cat == $cat6 || $parent == $cat6) $class = 'cat6'; | |
if ($cat == $cat7 || $parent == $cat7) $class = 'cat7'; |
This file contains 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
Экзаменатор не ставит перед собой задачу ввести в заблуждение, | |
запутать или потребовать от экзаменуемого совершить правонарушение. |
This file contains 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
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr | |
http://support.godaddy.com/help/article/3601/generating-a-certificate-signing-request-nginx | |
http://support.godaddy.com/help/article/4976/rekeying-an-ssl-certificate | |
# Be sure to remember to chain them! | |
cat gd_bundle-g2-g1.crt >> yourdomain.crt | |
# Move 'em | |
sudo mv yourdomain.crt /etc/ssl/certs/yourdomain.crt |
This file contains 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
javascript:(function(){function%20read(url){var%20r=new%20XMLHttpRequest();r.open('HEAD',url,false);r.send(null);return%20r.getAllResponseHeaders();}alert(read(window.location))})(); |
This file contains 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 echo ($i <= 12) ? $i : (($i <= 24) ? ($i - 12) : ($i - 24)) ?><?php echo $i < 12 ? 'am' : ($i > 23) ? 'am' : 'pm' ?> |
This file contains 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
""" | |
Detect a cycle in a linked list. Note that the head pointer may be 'None' if the list is empty. | |
A Node is defined as: | |
class Node(object): | |
def __init__(self, data = None, next_node = None): | |
self.data = data | |
self.next = next_node | |
""" |
This file contains 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
""" | |
Convert string to integer | |
""" | |
import unittest | |
class TestStringMethods(unittest.TestCase): | |
def test1(self): | |
self.assertEqual(myInt("123"), 123) |
This file contains 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
""" | |
Convert string to integer | |
""" | |
import unittest | |
class TestStringMethods(unittest.TestCase): | |
def test1(self): | |
self.assertEqual(myInt("123"), 123) |