Skip to content

Instantly share code, notes, and snippets.

View valerysntx's full-sized avatar
🔋
99%

valery sntx valerysntx

🔋
99%
  • Ukraine, Uzhgorod
View GitHub Profile
@koenbollen
koenbollen / Screen.cs
Created April 18, 2011 14:43
A simple but complete ScreenManager for XNA.
using Microsoft.Xna.Framework;
using System.Linq;
namespace Screens
{
/// <summary>
/// This is a screen that can be added to the ScreenManager. Extend it and add components
/// to it in the Initialize() method. You can also override the Update() and Draw() method.
/// </summary>
@koenbollen
koenbollen / SimpleConsole.cs
Created April 26, 2011 12:23
A simple line based game console for XNA.
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
@joelnet
joelnet / example.html
Created June 3, 2011 18:03
Unobtrusive Knockout support library for jQuery
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}
@bsatrom
bsatrom / addSpeaker-brief.html
Created July 1, 2011 20:07
Moving from markup-based KnockoutJS bindings to unobtrusive bindings (After)
<form id="addSpeaker">
<fieldset>
<legend>Speaker Info</legend>
Name: <input type="text" id="name" /> <br />
Bio: <textarea id="bio"></textarea> <br />
Twitter Handle: <input type="text" id="twitterHandle" /> <br />
State: <input type="text" id="state" /> <br />
Photo Url: <input type="text" id="photoUrl" />
</fieldset>
<fieldset>
@hubgit
hubgit / pdftotext.html
Created November 18, 2011 10:37
Embedding the PDFToText service in HTML
<!-- edit this; the PDF file must be on the same domain as this page -->
<iframe id="input" src="your-file.pdf"></iframe>
<!-- embed the pdftotext service as an iframe -->
<iframe id="processor" src="http://hubgit.github.com/2011/11/pdftotext/"></iframe>
<!-- a container for the output -->
<div id="output"></div>
<script>
@jsinh
jsinh / MSMQ using Rx - Code snippet for MSMQ receive timeout problem.cs
Created December 21, 2011 12:18
MSMQ using Rx - Code snippet for MSMQ receive timeout problem
using System;
using System.Messaging;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
namespace MSMQPubSubRx
{
class Program
{
public static MessageQueue msmqQueue;
@simX
simX / hidpi.txt
Created July 28, 2012 04:58
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;
// by the way, you need to logout and log back in for this to take effect. Or at least that's what
// Quartz Debug says. Who knows, maybe it's lying?
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from.
@vojtajina
vojtajina / all-templates.html
Created August 15, 2012 00:00
AngularJS: load all templates in one file
<script type="text/ng-template" id="one.html">
<div>This is first template</div>
</script>
<script type="text/ng-template" id="two.html">
<div>This is second template</div>
</script>
@phatboyg
phatboyg / ClassMappingExtension.cs
Created October 8, 2012 23:11
Automatonymous NHibernate Saga Mapping
using System;
using System.Linq.Expressions;
using Automatonymous;
using NHibernate.Mapping.ByCode;
public static class AutomatonymousNHibernateExtensions
{
public static void StateProperty<T, TMachine>(this IClassMapper<T> mapper, Expression<Func<T, State>> stateExpression)
where T : class
where TMachine : StateMachine, new()
@mrchief
mrchief / ServiceStackJsonFormatter.cs
Created November 9, 2012 05:11
Swap ASP.NET WebAPI JsonFormatter with ServiceStack.Text JSON formatter
public class ServiceStackJsonFormatter : MediaTypeFormatter
{
public ServiceStackJsonFormatter()
{
SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/json"));
SupportedEncodings.Add(new UTF8Encoding(false, true));
SupportedEncodings.Add(new UnicodeEncoding(false, true, true));
}