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 MAL Season Friends Watching | |
// @version 1.0 | |
// @match http://myanimelist.net/anime/season | |
// @grant none | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js | |
// @require https://cdn.rawgit.com/patik/within-viewport/1.0.0/withinviewport.js | |
// @require https://cdn.rawgit.com/patik/within-viewport/1.0.0/jquery.withinviewport.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js | |
// ==/UserScript== |
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
git ls-files | sort -f | uniq -cid | wc -l |
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
public class App { | |
public static void main(String[] args) { | |
NumberModel model = new NumberModel(); | |
NumberController controller = new NumberController(model); | |
} | |
} |
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 | |
/** | |
* Formats a number as a ruble currency string for web. | |
* | |
* @param float $number The number to be formatted. | |
* @param int $decimals [optional] | |
* @param boolean $trim_zero_decimals [optional] | |
* @param boolean $add_currency_suffix [optional] | |
* @return string A formatted version of number. |
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}(.*)') |
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
// 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
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
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
<?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); |