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 async Task<ActionResult> Index() { | |
var contacts = Client.DownloadStringTaskAsync("api/contacts"); | |
var temperature = Client.DownloadStringTaskAsync("api/temperature"); | |
var location = Client.DownloadStringTaskAsync("api/location"); | |
await Task.WhenAll(contacts, temperature, location); | |
ViewBag.Temperature = temperature.Result; | |
ViewBag.Location = location.Result; | |
ViewBag.Contacts = contacts.Result; |
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
if (!function_exists('mb_ucfirst') && extension_loaded('mbstring')) { | |
/** | |
* mb_ucfirst - преобразует первый символ в верхний регистр | |
* @param string $str - строка | |
* @param string $encoding - кодировка, по-умолчанию UTF-8 | |
* @return string */ | |
function mb_ucfirst($str, $encoding='windows-1251') { | |
$str = mb_ereg_replace('^[\ ]+', '', $str); | |
$str = mb_strtoupper(mb_substr($str, 0, 1, $encoding), $encoding). | |
mb_substr($str, 1, mb_strlen($str), $encoding); |
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
function cutString($string, $maxlen) { | |
$len = (mb_strlen($string) > $maxlen) | |
? mb_strripos(mb_substr($string, 0, $maxlen), ' ') | |
: $maxlen | |
; | |
$cutStr = mb_substr($string, 0, $len); | |
return (mb_strlen($string) > $maxlen) | |
? '"' . $cutStr . '..."' | |
: '"' . $cutStr . '"' | |
; |
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
<ul class="toc"> | |
<li><span>Глава 1</span><span class="page">2</span></li> | |
<li><span>Глава 2. Название длинное не влезло в одну строку и получился перенос на две</span><span class="page">32</span></li> | |
<li><span>Глава 3</span><span class="page">122</span></li> | |
</ul> |
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
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\CLSID\{A5B4F888-0757-11E2-9C50-18D66088709B}] | |
@="Microsoft Security Essentials" | |
"System.ControlPanel.Category"="5" | |
[HKEY_CLASSES_ROOT\CLSID\{A5B4F888-0757-11E2-9C50-18D66088709B}\DefaultIcon] | |
@="%SystemRoot%\\Installer\\{9D046B26-7978-47CD-91E6-AC3C1DFBC3D0}\\MSE.exe" | |
[HKEY_CLASSES_ROOT\CLSID\{A5B4F888-0757-11E2-9C50-18D66088709B}\Shell] |
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') |
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
// noprotect | |
var width = 320; | |
function taskQueue(capacity) { | |
var running = 0; | |
var queue = []; | |
function release() { | |
if (queue.length) { |
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
# Anonymous function | |
do -> | |
# Q returns new Library object that hold our selector. Ex: Q('.wrapper') | |
Q = (params) -> | |
new Library(params) | |
# In our Library we get our selector with querySelectorAll (we do not support < ie8) | |
# We also add selector length, version and twitter/github or whatever you like as information about your library. | |
Library = (params) -> | |
# Get params |
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
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain("js2.coffee") { | |
.code-box:not(.focus) .CodeMirror, .code-box-popup:not(.focus) .CodeMirror { | |
opacity: 1 !important; | |
} | |
/* Based on Sublime Text's Monokai theme */ |
OlderNewer