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 / ajax.js
Created February 1, 2014 21:07
Send Ajax request with vanilla JavaScript
var xhr = new XMLHttpRequest();
xhr.open('GET', '/api/sum?a=1&b=2', false);
xhr.send(null);
console.log(xhr.responseText); // prints 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 () {
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 / 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;
@koistya
koistya / TodoActions.js
Created September 30, 2014 21:00
Flux Action Creator Sample
'use strict';
var AppDispatcher = require('../AppDispatcher');
var TodoActions = {
ActionTypes: {
TODO_CREATE: 'TODO_CREATE'
},
create: function(text) {
@koistya
koistya / README.md
Last active August 29, 2015 14:08
Statics in React
var React = require('react');

var Counter = React.createClass({
  statics: {
    ticks: 0
  },
  render() {
    return <span>{Counter.ticks++}</span>;
 }
@koistya
koistya / web.config.xml
Last active August 29, 2015 14:08
Default configuration for hosting Node.js website in Azure Web Sites
<?xml version="1.0" encoding="utf-8"?>
<!--
This configuration file is required if iisnode is used to run node processes behind
IIS or IIS Express. For more information, visit:
https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config
-->
<configuration>
<system.webServer>