Skip to content

Instantly share code, notes, and snippets.

View Digiman's full-sized avatar
😃
Just do it!)

Andrey Kukharenko Digiman

😃
Just do it!)
View GitHub Profile
@Digiman
Digiman / base _html5.html
Last active April 4, 2017 10:49
Base HTML5 page to start from scratch
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Default Page Title</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="styles.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
@Digiman
Digiman / css_reset.css
Last active October 12, 2015 23:58
Standart CSS to reset standart (default) browser styles to use custom styles and it will work properly. Сброс стандартных стилей браузеров.
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
outline: none;
}
html { height: 101%; } /* always display scrollbars */
@Digiman
Digiman / css_print.css
Last active October 12, 2015 23:58
Prepare the page to print.
@media print {
* {
background: none !important;
color: black !important;
box-shadow: none !important;
text-shadow: none !important;
/* Images, vectors and such */
filter: Gray(); /* IE4-8: depreciated */
filter: url('desaturate.svg#grayscale'); /* SVG version for IE10, Firefox, Safari 5 and Opera */
@Digiman
Digiman / LogHelper.cs
Last active August 29, 2015 14:01
Sample class for work with NLog from common library in whole solution in Visual Studio (for large projects).
/// <summary>
/// Помошник по ведению логов
/// Статический интерфейс над библиотекой для логирования (в данном случае - NLog2)
/// </summary>
public static class LogHelper
{
/// <summary>
/// Инициализация логгера.
/// </summary>
private static Logger _logger = LogManager.GetCurrentClassLogger();
@Digiman
Digiman / FilesHelper.cs
Last active August 29, 2015 14:01
Sample class for work with files. Used by me at one large application.
/// <summary>
/// Вспомогательный класс для работы с файлами.
/// </summary>
public static class FilesHelper
{
/// <summary>
/// Получение расширения файла.
/// </summary>
/// <param name="filename">Файл для разбора (полный путь к нему).</param>
/// <returns>Возвращает расширение файла.</returns>
@Digiman
Digiman / VizualizeAnimation.m
Last active August 29, 2015 14:01
Визуализация графика поверхности для задачи анализа ЭМП, распределенного по расчетной области. Применяется в приложении EMFF.
% специальный скрипт для импорта файлов с результатами анализа (разрез
% секции) и визуализации (с анимацией) - построение графика уровня
function VizualizeAnimation(xfile, yfile, lenght, aniFile)
% чтение квадратной матрицы из файла текстового
function [matrix] = ImportMatrix(filename, size)
matrix = zeros(size, size);
file = fopen(filename,'r');
[matrix, size] = fscanf(file,'%f',[size, size]);
fclose(file);
@Digiman
Digiman / Utils.ts
Last active July 19, 2016 14:34
The simple logger for a web application. Uses default console to output simple messages and [toastr](https://github.com/CodeSeven/toastr) to show notification.
/**
* Module with common classes, functions and etc. as utils for the whole web application.
*/
module Utils {
"use strict";
/**
* Common interface for Logger classes on client side (JavaScript).
*/
export interface ILogger {
@Digiman
Digiman / StorageHelper.ts
Last active December 27, 2023 13:34
Simple helper module on TypeScript for using local storage (HTML5) in browser. Also have the class to store the list of emails that need to use for autocomplete in the some pages.
// module with classes and logic for working with local storage in browsers via JavaScript
// see also: http://professorweb.ru/my/html/html5/level5/5_1.php
module StorageHelper {
export interface IStorageItem {
key: string;
value: any;
}
export class StorageItem {
key: string;
@Digiman
Digiman / ReferencesExtensions.ts
Created April 13, 2015 10:10
Simple code that can be used for store reference data for working with lists in web app with knockout.js.
// module with some classes that can used in the references or another parts of the application
module ReferencesExtensions {
export class ReferenceData<T> {
public data: KnockoutObservableArray<T>;
public apiPath: string;
logger: Utils.Logger;
constructor(apiPath: string) {
this.apiPath = apiPath;
this.data = ko.observableArray<T>([]);
@Digiman
Digiman / PagedObservableArray.ts
Created July 18, 2015 11:23
Small TypeScript (JS) class to use for observable arrays that need to be devided on pages.
// Взято по примеру из источника: http://blog.greatrexpectations.com/2012/07/11/paging-lists-with-knockout/
export class PagedObservableArray {
options: any;
//public members
allData: KnockoutObservableArray<any>;
pageSize: KnockoutObservable<number>;
pageIndex: KnockoutObservable<number>;
page: KnockoutComputed<any>;
pageCount: KnockoutComputed<number>;