source "https://rubygems.org"
ruby "2.2.3"
gem 'sinatra'
gem 'thin'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LocalTemplateRenderer : ITemplateRenderer | |
{ | |
public byte[] ToPdf(System.Xml.Linq.XDocument dataStructure, System.IO.Stream template) | |
{ | |
// Prepare rendering parameters | |
var _param = new RenderingParameters(); | |
var _output = new OutputInformation(); | |
_param.OutputFormat = Engine.OutputFormat.PDF; | |
_param.Template = new LocalDocumentTemplate(template, null, Engine.XsltEngine.MSXML, "en_EN", null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#DangerZone so be sure to "back up" your current work by creating a new branch. | |
git co org-teams | |
git branch org-teams-bak | |
You should have a remote named upstream that points to the original octokit repository. To very, run: | |
git remote -v | |
If you don't have a remote named upstream, you can run this command: | |
git remote add upstream https://github.com/octokit/octokit.net.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (var repo = new Repository("path\to\repo.git")) | |
{ | |
// Object lookup | |
var obj = repo.Lookup("sha"); | |
var commit = repo.Lookup<Commit>("sha"); | |
var tree = repo.Lookup<Tree>("sha"); | |
var tag = repo.Lookup<Tag>("sha"); | |
// Rev walking | |
foreach (var c in repo.Commits.Walk("sha")) { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slideIt(current, next) { | |
var container = $('#slider'); | |
var width = parseInt($('#slider').css('width')); | |
container.find(current).animate({ 'margin-left': '-' + width + 'px' }, 300, function () { | |
container.find(current).addClass("hide").css("margin-left", 0); | |
container.find(next).removeClass("hide"); | |
}); | |
return false; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
You can now create a spinner using any of the variants below: | |
$("#el").spin(); // Produces default Spinner using the text color of #el. | |
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el. | |
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color). | |
$("#el").spin({ ... }); // Produces a Spinner using your custom settings. | |
$("#el").spin(false); // Kills the spinner. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Global : System.Web.HttpApplication | |
{ | |
protected void Application_Start(object sender, EventArgs e) | |
{ | |
Application["NHSessionFactory"] = CreateSessionFactory(); | |
} | |
private static ISessionFactory CreateSessionFactory() | |
{ | |
return Fluently.Configure() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map = orders => from order in orders | |
let lastPayment = order.Payments.LastOrDefault() | |
select new | |
{ | |
Query = new object[] | |
{ | |
order.FirstName, | |
order.LastName, | |
order.OrderNumber, | |
order.Email, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class WordToPdfConverter : IDisposable | |
{ | |
private readonly MsWordApplication _application = new MsWordApplication {Visible = true}; | |
internal WordToPdfConverter() | |
{ | |
} | |
public void Convert(string from, string to) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
/** | |
* Author: Rob Audenaerde | |
*/ | |
function resetTableSizes (table, change, columnIndex) | |
{ | |
//calculate new width; | |
var tableId = table.attr('id'); | |
var myWidth = $('#'+tableId+' TR TH').get(columnIndex).offsetWidth; |