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
| /** | |
| * Advanced Window Snap | |
| * Snaps the Active Window to one of nine different window positions. | |
| * | |
| * @author Andrew Moore <andrew+github@awmoore.com> | |
| * @version 1.0 | |
| */ | |
| /** | |
| * SnapActiveWindow resizes and moves (snaps) the active window to a given position. |
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 | |
| function base64url_encode($data) { | |
| return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); | |
| } | |
| function base64url_decode($data) { | |
| return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT)); | |
| } | |
| ?> |
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
| define("DOMAIN", "test.se"); | |
| define("MAILGUN_API", "XXX123"); // Mailgun Private API Key | |
| function br2nl($string) { | |
| return preg_replace('/\<br(\s*)?\/?\>/i', "\n", $string); | |
| } | |
| function mg_send($to, $subject, $message) { | |
| $ch = curl_init(); |
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
| @-moz-document domain("world-of-kwg.livejournal.com"), domain("world-of-tanks.livejournal.com"), domain("world-of-ru.livejournal.com") { | |
| /* справа от никнейма разработчика в комментах отображаем иконку клана WG */ | |
| div[data-username="makarovslava"] span.b-leaf-username-name, | |
| div[data-username="alfrina"] span.b-leaf-username-name, | |
| div[data-username="alyonka"] span.b-leaf-username-name, | |
| div[data-username="kukuk"] span.b-leaf-username-name, | |
| div[data-username="yuripasholok"] span.b-leaf-username-name, | |
| div[data-username="oilan"] span.b-leaf-username-name, |
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 logging | |
| import multiprocessing | |
| import time | |
| import mplog | |
| FORMAT = '%(asctime)s - %(processName)s - %(levelname)s - %(message)s' | |
| logging.basicConfig(level=logging.DEBUG, format=FORMAT) | |
| existing_logger = logging.getLogger('x') |
Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.
Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!
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 isPortTaken = function(port, fn) { | |
| var net = require('net') | |
| var tester = net.createServer() | |
| .once('error', function (err) { | |
| if (err.code != 'EADDRINUSE') return fn(err) | |
| fn(null, true) | |
| }) | |
| .once('listening', function() { | |
| tester.once('close', function() { fn(null, false) }) | |
| .close() |
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 UTM param stripper | |
| // @author Paul Irish | |
| // @namespace http://github.com/paulirish | |
| // @version 1.2 | |
| // @description Drop the UTM params from a URL when the page loads. | |
| // @extra Cuz you know they're all ugly n shit. | |
| // @include http*://* | |
| // ==/UserScript== |
NewerOlder