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: utf-8 -*- | |
""" | |
Usage: | |
python album_fetcher.py https://plus.google.com/photos/118353143366443526186/albums/5626152497309725217 | |
python album_fetcher.py https://plus.google.com/118353143366443526186 | |
python album_fetcher.py https://plus.google.com/118353143366443526186 [email protected] yourpassword | |
python album_fetcher.py https://plus.google.com/118353143366443526186 [email protected] yourpassword /out_dir/ | |
TODO: use opt parse | |
""" | |
import os |
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
$(window).load(function(){ | |
var live_selectors = []; | |
$($._data(document, 'events').click).each(function(){ | |
live_selectors.push(this.selector); | |
}); | |
$('a[href=""], a[href^="#"]').each(function(){ | |
var link = this; | |
if (this.onclick === null && |
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 | |
$access_token = ""; | |
if (empty($_COOKIE["access_token"]) || $_COOKIE["access_token"] !== $access_token) { | |
header('HTTP/1.0 404 Not Found'); | |
echo "<h1>404 Not Found</h1>"; | |
echo "The page that you have requested could not be found."; | |
die(); | |
} else { | |
header('Connection: close'); | |
header('X-Accel-Buffering: no'); |
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 | |
# | |
# this script should not be run directly, | |
# instead you need to source it from your .bashrc, | |
# by adding this line: | |
# . ~/bin/cdr.sh | |
# | |
function cdr() { | |
replacement=$1 | |
array=(${PWD//\// }) |
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 | |
// http/1.1 header to disable browsers cache | |
header('Cache-Control: no-cache'); | |
// tell nginx to disable buffering | |
header('X-Accel-Buffering: no'); | |
// disable apache mod_gzip and mod_deflate | |
apache_setenv('no-gzip', 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
http://youtrack.jetbrains.com/issue/WI-17096 | |
Ctrl + R | |
(<\?=?) ([^\s])|([^\s]) (\?>) | |
$1$2$3$4 |
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
for %%f in (*.png *.jpg) do convert "%%f" ^ | |
-filter Lanczos -resize "1366x768^" ^ | |
-unsharp 0x0.669+0.4+0.008 ^ | |
-gravity center -extent 1366x768 ^ | |
-set filename:f "%%t_%%wx%%h.png" "png:%%[filename:f]" | |
rem or use this cmdline: | |
rem for %f in (*.png *.jpg) do convert "%f" -filter Lanczos -resize "1366x768^" -unsharp 0x0.669+0.4+0.008 -gravity center -extent 1366x768 -set filename:f "%t_%wx%h.png" "png:%[filename:f]" |
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
// go to your myanimelist.net | |
// click "Plan to Watch" | |
// scrooll all the way down | |
// exec this from console | |
const calc_weight = function (score, users) { | |
const mean = 7.0; | |
const minimum = 30000.0; | |
return (score * users + mean * minimum) / (users + minimum); // imdb top250 | |
}; |
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
// ==UserScript== | |
// @name lomarengas distance matrix | |
// @description shows distance from border control points | |
// @version 20140910 | |
// @match http://www.lomarengas.fi/* | |
// @updateURL https://gist.github.com/thekot/339e229ddb59ff66c8d0/raw/lomarengas.user.js | |
// ==/UserScript== | |
var map_canvas = document.querySelector('#map_canvas'); | |
var geo = document.querySelector('div[itemprop="geo"]'); |
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: utf-8 | |
# based on http://baguzin.ru/wp/?p=7873 | |
import re | |
class AssParser: | |
def __init__(self): | |
self.dialog_re = re.compile(r'Dialogue:(?:[^,]*,){9}(.*)') |
OlderNewer