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
^__^ / | |
(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
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
<?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
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
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
#!/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
/* Anagram: a little filter that emits anagrams of its argument. | |
* | |
* This program's main point of interest is its speed, which it | |
* obtains by using native FPU operations to do the anagram tests. | |
* | |
* The basic idea is to form a one-to-one mapping of letter values to prime | |
* numbers, allowing words to be represented as composite numbers by | |
* multiplying together the primes that map each letter in the word. | |
* Words formed from the same letters, regardless of order, will then map | |
* to the same composite number. Also, if one word's number divides exactly |
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 fs = require('fs'); | |
function thread(fn) { | |
var gen = fn(); | |
function next(err, res) { | |
var ret = gen.next(res); | |
if (ret.done) return; | |
ret.value(next); | |
} |
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 trackOutboundLink = function(event) { | |
var url = this.href; | |
ga('send', 'event', 'outbound', 'click', url, { | |
'transport': 'beacon', | |
'hitCallback': function(){document.location = url;} | |
}); | |
event.preventDefault(); | |
} | |
Array.prototype.slice.call(document.getElementsByTagName('a')).map(function(el) { |