Skip to content

Instantly share code, notes, and snippets.

View koistya's full-sized avatar
🏠
Working from home

Konstantin Tarkus koistya

🏠
Working from home
View GitHub Profile
@koistya
koistya / closure-example.js
Created February 12, 2014 11:49
JavaScript Closure Example
var bind = function(x) {
return function(y) { return x + y; };
}
var plus5 = bind(5);
alert(plus5(3));
@koistya
koistya / README.md
Last active August 29, 2015 13:58
Katana/Owin StaticFiles Usage Scenario

Directory layout:

.
├── bin
├── public
│   └── test.txt
├── packages.config
├── Startup.cs
├── Web.config
// For more information on how to configure Gulp.js build system, please visit:
// https://github.com/gulpjs/gulp/blob/master/docs/API.md
'use strict';
var gulp = require('gulp');
var browserify = require('gulp-browserify');
var changed = require('gulp-changed');
var jshint = require('gulp-jshint');
var less = require('gulp-less');
@koistya
koistya / gulpfile.js
Last active August 29, 2015 14:02
Deploy to GitHub Pages with Gulp.js
var gulp = require('gulp');
var gutil = require('gulp-util');
var path = require('path');
// Settings
var deployUrl = 'https://github.com/{name}/{name}.github.io.git';
var buildPath = './build';
// Build website into the `./build` folder
gulp.task('build', function () {
@koistya
koistya / AccountController
Created June 11, 2014 21:42
ASP.NET MVC Account Controller
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.AspNet.Identity.Owin;
@koistya
koistya / modal.html
Last active September 18, 2022 05:36
Modal dialog with a YouTube player
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
public static string Fun(int num)
{
if (num == 0)
{
return "0";
}
var result = new StringBuilder();
var count = 0;
@if $menu_location == "right" {
right: -$mobilemenu_width;
//@include box-shadow(40px, 40px, 40px, -40px, rgba(0,0,0,0.9), inset);
} @else {
left: -$mobilemenu_width;
//@include box-shadow(-40px, 0px, 40px, -40px, rgba(0,0,0,0.9), inset);
}
@koistya
koistya / Navbar.jsx
Last active September 10, 2016 16:26
React.js Component Sample
/**
* @jsx React.DOM
*/
'use strict';
var React = require('react');
var {Link} = require('react-router');
var Navbar = React.createClass({
@koistya
koistya / IdentityDbContext.cs
Created September 28, 2014 14:11
ASP.NET Identity
namespace Microsoft.AspNet.Identity.EntityFramework
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Common;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.Infrastructure.Annotations;
using System.Data.Entity.ModelConfiguration;