Skip to content

Instantly share code, notes, and snippets.

View kurakinvit's full-sized avatar

Vitaliy kurakinvit

View GitHub Profile
@kurakinvit
kurakinvit / cool_tooltips.html
Last active April 9, 2018 09:52
Создание красивых сообщений #css @css
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Всплывающие подсказки</title>
<style type="text/css">
.tooltip {
border-bottom: 1px dotted #000000; color: #000000; outline: none;
cursor: help; text-decoration: none;
@kurakinvit
kurakinvit / Conditions
Last active December 30, 2015 09:09
Полезняхи
Пример с использованием Conditional
#define TRACE_ON
using System;
using System.Diagnostics;
public class Trace
{
[Conditional("TRACE_ON")]
public static void Message(string msg)
{
@kurakinvit
kurakinvit / cookies.js
Created December 3, 2013 12:30
Советы по JavaScript
$(document).ready(function(){
//Referances
//jQuery Cookie : https://github.com/carhartl/jquery-cookie
//Modal : http://getbootstrap.com/javascript/#modals
var my_cookie = $.cookie($('.modal-check').attr('name'));
if (my_cookie && my_cookie == "true") {
$(this).prop('checked', my_cookie);
console.log('checked checkbox');
}
else{
@kurakinvit
kurakinvit / Azure.md
Created December 2, 2013 07:04
Установка collation для столбца в SQL Azure Database

Задача была простая – переустановить collation для столбца, хранящегося в таблице, хранящегося в базе данных, хранящейся в SQL Azure Databases. Так как я невеликий специалист в SQL Server, поиск решения занял минут N.

По умолчанию collation проставляются в SQL_Latin1_General_CP1_CI_AS, на сегодняшний момент управлять этим на уровне базы или сервера невозможно.

Поменять же collation на более низком уровне можно с помощью запроса

ALTER TABLE [dbo].[TableName] ALTER COLUMN [ColumnName] NVARCHAR(MAX) COLLATE Cyrillic_General_CI_AS NULL;
>GO

@kurakinvit
kurakinvit / ternar_cs.md
Created December 2, 2013 07:00
Null coalescing operator

Null coalescing operator

Используется для определения значения по умолчанию для нулевых типов значений или ссылочных типов. Он возвращает левый операнд, если операнд не нулевой, в противном случае возвращается правый операнд.

Пример

У меня был List, и, если этот List == null, мне надо было возвратить новый экземпляр List, иначе – OK. Можно это, конечно, сделать и тернарным оператором:

@kurakinvit
kurakinvit / distribute_app.md
Created November 20, 2013 19:13
Для скачивания приложений с parking
http://dribbble.com/shots/631004-Wallpaper-Retina
@kurakinvit
kurakinvit / datetime
Last active January 20, 2017 13:01
Ввод/вывод и Культура при работе с числами
Хитрости при работе с датой и временем:
http://blog.vkuznetsov.ru/posts/2011/09/18/malenkie-chudesa-csharp-net-datetime-s-dopolnitelnymi-preimushhestvami#.UtfINsbIZHQ
int yr = DateTime.Today.Year;
int mth = DateTime.Today.Month;
// начало текущего месяца
DateTime firstDay = new DateTime(yr, mth, 1);
deStart.Date = firstDay;
// конец текущего месяца
@kurakinvit
kurakinvit / css_resources.md
Created November 12, 2013 19:06 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@kurakinvit
kurakinvit / javascript_resources.md
Created November 12, 2013 19:06 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage