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 | |
import sys, shutil, os.path | |
if len(sys.argv) != 3: | |
sys.stderr.write('Usage: %s PLAYLIST DEST\n\n' % sys.argv[0]) | |
sys.exit(1) | |
exported, dest = sys.argv[1:] | |
lines = unicode(open(exported).read(), 'utf16').split('\r')[1:] | |
files = ['/Volumes/' + line.split('\t')[-1].replace(':', '/') for line in lines] | |
for file in files: | |
if os.path.exists(file) and os.path.isfile(file): shutil.copy(file, dest) |
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
RewriteEngine On | |
RewriteBase /baba/ | |
RewriteRule ^$ ../trunk/$1?_config=baba [L,QSA] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ ../trunk/$1?_config=baba [L,QSA] |
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 | |
require_once 'PHPUnit/Framework.php'; | |
/** | |
* Matches a php code string upon a template of tokens | |
* | |
* @param string $code String of php code. | |
* @param string $template See the tests below for examples. | |
* | |
* @return array|false Associative array of all variables or false if no match was found |
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
""" | |
E=7 | |
TALLET + | |
SIGNAL | |
------ | |
ELAINE | |
""" | |
letters = set('T A L L E T S I G N A L E L A I N E'.split()) | |
assoc = {letter: None for letter in letters} |
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
# coding: utf-8 | |
import email, imaplib, chardet, pickle | |
m = imaplib.IMAP4_SSL('imap.gmail.com', 993) | |
m.login('[email protected]', 'тринайсетзелениголиорангутанагонятгоркатапеперудка') | |
m.select('&BD8ENQRCBDA- &BDcEMAQ0BDAERwQw-') # пета задача | |
typ, data = m.search(None, 'ALL') | |
essays = [] | |
for num in data[0].split(): | |
print 'Getting %s' % num |
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
# coding: utf-8 | |
from xmlrpclib import ServerProxy, Binary | |
import pickle | |
import re | |
server = ServerProxy("http://path-to-not-so-random-wp-installtion/xmlrpc.php") | |
essays = pickle.load(open('essays')) | |
for essay in essays: | |
try: | |
match = re.search(r'<([^<>]+)>\s*$', essay['from']) |
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 | |
import os | |
import sys | |
import time | |
import random | |
messages = { | |
0: "It is Midnight! And that's all", | |
1: "It's 1 o'clock and the weather outside is fine. Do you wanna go out for a walk?", | |
6: "A third of the number of the beast o'clock", | |
} |
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 | |
/* | |
Plugin Name: Different theme | |
Description: Use a different theme on certain conditions | |
Author: Nikolay Bachiyski | |
Version: 1.0 | |
*/ | |
class Different_Theme { | |
function __construct() { |
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
[[1, "Hydrogen", "H"], [2, "Helium", "He"], [3, "Lithium", "Li"], [4, "Beryllium", "Be"], [5, "Boron", "B"], [6, "Carbon", "C"], [7, "Nitrogen", "N"], [8, "Oxygen", "O"], [9, "Fluorine", "F"], [10, "Neon", "Ne"], [11, "Sodium", "Na"], [12, "Magnesium", "Mg"], [13, "Aluminium", "Al"], [14, "Silicon", "Si"], [15, "Phosphorus", "P"], [16, "Sulfur", "S"], [17, "Chlorine", "Cl"], [18, "Argon", "Ar"], [19, "Potassium", "K"], [20, "Calcium", "Ca"], [21, "Scandium", "Sc"], [22, "Titanium", "Ti"], [23, "Vanadium", "V"], [24, "Chromium", "Cr"], [25, "Manganese", "Mn"], [26, "Iron", "Fe"], [27, "Cobalt", "Co"], [28, "Nickel", "Ni"], [29, "Copper", "Cu"], [30, "Zinc", "Zn"], [31, "Gallium", "Ga"], [32, "Germanium", "Ge"], [33, "Arsenic", "As"], [34, "Selenium", "Se"], [35, "Bromine", "Br"], [36, "Krypton", "Kr"], [37, "Rubidium", "Rb"], [38, "Strontium", "Sr"], [39, "Yttrium", "Y"], [40, "Zirconium", "Zr"], [41, "Niobium", "Nb"], [42, "Molybdenum", "Mo"], [43, "Technetium", "Tc"], [44, "Ruthenium", "Ru"], [45, "Rhodium", |
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 | |
function redirect_on_bad_login( $redirect_to, $redirect_to_from_request, $user ) { | |
if ( is_wp_error( $user ) && isset( $_POST['wp-submit'] ) ) { | |
wp_redirect( 'http://dir.bg/' ); | |
exit(); | |
} | |
return $redirect_to; | |
} |
OlderNewer