Skip to content

Instantly share code, notes, and snippets.

View tarasn's full-sized avatar
馃幆
Focusing

Taras Naumtsev tarasn

馃幆
Focusing
View GitHub Profile
@tarasn
tarasn / button-text.js
Created June 29, 2014 13:59
Place text on top of over images (sprites, buttons etc) tags: phaser
var sprite = game.add.sprite(0, 0, 'button');
var text = game.add.text(0, 0, "Some text", {font: "16px Arial", fill: "#ffffff"});
sprite.addChild(text);
// now text will be positioned relative to the sprite, and will move around with it like a group - except with sprites you can still use physics :)
@tarasn
tarasn / Author.cs
Last active August 29, 2015 14:00
Blog model using Fluent Nhibernate
using System;
namespace NHibernateExperimentsV2.ManyToMany.Data
{
public class Author
{
public virtual Guid Id { get; set; }
public virtual string FullName { get; set; }
}
}
@tarasn
tarasn / app.config
Created March 16, 2014 10:21
Enabling log4net internal tracing
<appSettings>
<add key="log4net.Internal.Debug" value="true"/>
</appSettings>
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add
name="textWriterTraceListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="C:\log4net.txt" />
@tarasn
tarasn / SHA1Util.cs
Created January 21, 2014 09:14
Generate SHA1 hex string for a string encoded as UTF8 ( https://gist.github.com/kristopherjohnson/3021045#file-sha1util-cs )
using System.Security.Cryptography;
using System.Text;
namespace Snippets
{
public static class SHA1Util
{
/// <summary>
/// Compute hash for string encoded as UTF8
/// </summary>
@tarasn
tarasn / NunitTest.cs
Created December 9, 2013 07:28
NUnit test boilerplate
using NUnit.Framework;
[TestFixture]
public class SomeTest
{
[SetUp]
public void Setup()
{
}
@tarasn
tarasn / Program.cs
Created November 24, 2013 10:54
An example of usage of Nustache framework( mustache for .NET) .Rendering object, collection and using a condition
using System;
using System.Collections.Generic;
using MyNustache.Properties;
using Nustache.Core;
namespace MyNustache
{
class Name
{
@tarasn
tarasn / image-resizing.html
Created November 10, 2013 09:35
Image resizing via css
<!DOCTYPE html>
<html>
<head>
<title>2 - Responsive image</title>
<style>
img {
max-width: 100%;
min-width: 500px;
height: auto;
}
@tarasn
tarasn / application-he.json
Created November 6, 2013 22:16
Localization to Russian and Hebrew using Zepto.js and localization plugin (jquery)
{
"title": "转专讙讜诐 砖驻讜转",
"link": "注讘专讬转",
"footer": {
"disclaimer": "诇讛转专讗讜转"
}
}
@tarasn
tarasn / EnumT.cs
Created September 11, 2013 10:44
Strongly typed version of Enum with Parsing and performance improvements. Originally published at http://damieng.com/blog/2010/10/17/enums-better-syntax-improved-performance-and-tryparse-in-net-3-5
// Copyright (c) Damien Guard. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
// Originally published at http://damieng.com/blog/2010/10/17/enums-better-syntax-improved-performance-and-tryparse-in-net-3-5
using System;
using System.Collections.Generic;
using System.Linq;
namespace DamienG.System
@tarasn
tarasn / RunMsBuild.cs
Created September 10, 2013 06:36
Running a ms build script ,output to console ,passing a parameter to executing script
using System;
using Microsoft.Build.BuildEngine;
using Project = Microsoft.Build.BuildEngine.Project;
namespace ConsoleApplication16
{
class Program
{
[STAThread]
static void Main(string[] args)