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
#!/bin/bash -e | |
files=$(find . -name "*.php" -o -name "*.html" -o -name "*.htm" -o -name "*.tpl" -o -name "*.js" -o -name "*.txt" -o -name "*.css") | |
for f in $files; do | |
iconv -f latin2 -t utf8 "$f" > "$f.utf8" | |
mv "$f.utf8" "$f" | |
done |
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 uinput | |
import time | |
def sequence(device,t1,t2, t3, t4): | |
device.emit(uinput.KEY_W, 1) # Press. | |
time.sleep(t1) | |
device.emit(uinput.KEY_O, 1) # Press. | |
time.sleep(t1) | |
device.emit(uinput.KEY_O, 0) # Release. | |
device.emit(uinput.KEY_W, 0) # Release. |
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 django.core.management.base import BaseCommand | |
from django.contrib.auth.models import User | |
from profiles.models import UserProfile | |
class Command(BaseCommand): | |
def handle(self, *args, **options): | |
for user in User.objects.all(): | |
try: |
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 | |
if ($_GET) { | |
$id = $_GET['id']; | |
} elseif($argv) { | |
$id = $argv[1]; | |
} | |
echo $id."\n"; |
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
var mobile_url = 'http://m.bankier.pl/art/{ID}/'; | |
var desktop_url = /-(\d+)\.html/; | |
var agent = navigator.userAgent.toLowerCase(); | |
var isUAMobile =!!(agent.match(/(iPhone|iPod|blackberry|android 0.5|htc|lg|midp|mmp|mobile|nokia|opera mini|palm|pocket|psp|sgh|smartphone|symbian|treo mini|Playstation Portable|SonyEricsson|Samsung|MobileExplorer|PalmSource|Benq|Windows Phone|Windows Mobile|IEMobile|Windows CE|Nintendo Wii)/i)); | |
var isUATablet =!!(agent.match(/(iPad|SCH-I800|xoom|kindle)/i)); | |
var page = document.location.pathname.match(desktop_url); | |
if (page && (isUAMobile || isUATablet)) { | |
document.location.href = mobile_url.replace(/{ID}/, page[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
^__^ / | |
(oo)\_______/ _________ | |
(__)\ )=( ____|_ \_____ | |
||----w | \ \ \_____ | | |
|| || || || |
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
* | |
!.gitignore |
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
$.post($(this).attr('action'), form.serialize(), function(answear){ | |
form.find('.errorlist').remove(); | |
$.each(answear['errors'], function(key, value){ | |
var errors = ''; | |
$.each(value, function(i,v){ | |
errors += '<li>'+v+'</li>'; | |
}); | |
form.find('#id_'+key).before('<ul class="errorlist">'+errors+'</ul>'); | |
}); | |
if (answear['id']){ |
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 urllib2 | |
import json | |
import sys | |
from pprint import pprint | |
def main(url): | |
return json.load(urllib2.urlopen(url)) |
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 sys | |
from random import randrange | |
def main(digits_no): | |
return ''.join([str(randrange(0, 10)) for x in xrange(digits_no)]) | |
if __name__ == '__main__': |