Skip to content

Instantly share code, notes, and snippets.

View happygrizzly's full-sized avatar
🐻

Aleksey Filippov happygrizzly

🐻
View GitHub Profile
@happygrizzly
happygrizzly / CoffeeCompiler.cs
Created December 22, 2015 10:03 — forked from Crisfole/CoffeeCompiler.cs
CoffeeScript and Less
using System;
using System.Collections.Generic;
using System.IO;
using MsieJavaScriptEngine;
public class CoffeeScriptCompiler : ContentCompiler {
public CoffeeScriptCompiler() {
Javascript.Engine.RegisterCompiler("CoffeeScript", LoadCoffeeScript, MakeCompiler);
}
@happygrizzly
happygrizzly / UtilityController.php
Last active September 11, 2015 06:43 — forked from jchaney01/UtilityController.php
Angular.js Uploadify Directive with Image Editor and Laravel Backend
class UtilityController extends BaseController {
public function upload()
{
$file = Input::file('Filedata');
$name = Date("now").'-'.$file->getClientOriginalName();
$uploadSuccess = $file->move(public_path().'/uploads',$name);
if( $uploadSuccess ) {
return Response::json(array(
"status"=>"200",
@happygrizzly
happygrizzly / ng-prism.js
Last active September 11, 2015 06:21 — forked from mikomatic/ng-prism.js
Angularjs directive with prism code highlight
/**
* Usage
*
* <ng-prism class="language-css">
* body {
* color: red;
* }
* </ng-prism>
*
* the files prismjs and prism css must be included in HTML, use class "language-XXX" to specify language
@happygrizzly
happygrizzly / gist:ba6d197ee096a1e0f6b5
Last active September 2, 2015 08:04 — forked from alexbeletsky/gist:1325577
ASP.NET MVC2 Views web.config
<?xml version="1.0"?>
<configuration>
<system.web>
<httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
<!--
Enabling request validation in view pages would cause validation to occur

Owin Authentication with Web API 2

Using Microsoft.Owin.Security along with .NET Web API 2 for authentication on Single Page Applications.

My example is split up into 2 different projects, API which is WebAPI2 project and MyProj which is a basic MVC that contains primarily only JavaScript/CSS/etc and the startup classes.

API > AccountController.cs

namespace API

{

using System;
using System.Threading.Tasks;
namespace Life
{
public class LifeSimulation
{
private bool[,] world;
private bool[,] nextGeneration;
private Task processTask;