This file contains 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
# Haxe HashLink 1.11 | |
{ | |
stdenv, libpng, libvorbis, openal, neko, | |
SDL2, mbedtls, libuv, libjpeg, libGLU, | |
autoPatchelfHook | |
}: | |
stdenv.mkDerivation rec { | |
name = "hl-${version}"; | |
system = "x86_64-linux"; | |
version = "1.11"; |
This file contains 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
'use strict'; | |
Object.ksort = function(oldObject) { | |
var newObject = {}; | |
Object.keys(oldObject).sort().forEach(function(key) { | |
newObject[key] = oldObject[key]; | |
}); | |
return newObject; |
This file contains 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/sh | |
nano ~/.local/share/applications/video.desktop | |
/* Содержание: | |
[Desktop Entry] | |
Name=Video | |
Exec=sh -c '/usr/bin/mpv --geometry=480x270-0-0 --ontop --ytdl-format=18 $(echo "%u" | sed -e "s/video:\/\///g")' | |
Type=Application | |
Terminal=false |
This file contains 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 partial class ShotForm : Form | |
{ | |
[DllImport("user32")] | |
public static extern int RegisterHotKey(IntPtr hwnd, int id, int fsModifiers, int vk); | |
[DllImport("user32.dll")] | |
static extern bool UnregisterHotKey(IntPtr hWnd, int id); | |
/* | |
А теперь некоторые необязательные константы в виде #define - style. Те что MOD_ - описывают константы модификаторов, | |
т.е. хоткей будет состоять из нажатия модификаторов + клавиша. Ну в WM_HOTKEY событие которое отправляет Windows |
This file contains 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
enum EmpType | |
{ | |
Дворник = 403, | |
Программист, | |
Президент | |
} |
This file contains 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
static class IntegerExtend | |
{ | |
/// <summary> | |
/// Склоняет существительное в зависимости от числительного идущего перед ним. | |
/// </summary> | |
/// <param name="num">Число идущее перед существительным.</param> | |
/// <param name="normative">Именительный падеж слова.</param> | |
/// <param name="singular">Родительный падеж ед. число.</param> | |
/// <param name="plural">Множественное число.</param> | |
public static string Decline(this int num, string nominative, string singular, string plural) |
This file contains 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 | |
/** | |
* Ищет в массиве $a значение по ключам заданным | |
* в $b (с учетом их порядка). Возвращает первый | |
* элемент по найденному ключу-совпадению | |
* | |
* @param array $a Ассоциативный массив по которому ищем | |
* @param array $b Массив ключей по которым ведется поиск | |
* @param mixed &$fk Найденный ключ |
This file contains 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 | |
/** | |
* Возвращает массив всех директорий указанной директории рекурсивно | |
* @param string $dir Путь к директории | |
* @param string $filter Фильтр имени директории | |
* return array Массив путей к директориям | |
*/ | |
function subdirs($dir, $filter = '*') | |
{ |
This file contains 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 pt($data, $openTree = true, $maxLevel = 0, $path = array()) | |
{ | |
$level = count($path); | |
static $id = 0; | |
if ( $level == 0 ) | |
$id++; | |
?> |
This file contains 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 | |
/** | |
* Получает имя файла относительно корня сайта | |
* @param string $syspath Полное имя файла | |
*/ | |
function syspath($webpath) | |
{ | |
return preg_match('~^('.$_SERVER['DOCUMENT_ROOT'].')~', $webpath) ? $webpath : $_SERVER['DOCUMENT_ROOT'].$webpath; | |
} |
NewerOlder