This file contains hidden or 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
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
This file contains hidden or 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 hidden or 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 hidden or 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 decimal GetTaxes(decimal salary) | |
{ | |
decimal tax = 0; | |
var progressiveTaxation = new[] { 0.1m, 0.14m, 0.23m, 0.3m, 0.33m, 0.45m }; | |
var progressionSlices = new[] { 5070 - 0, 8660 - 5070, 14070 - 8660, 21240 - 14070, 40230 - 21240, decimal.MaxValue }; | |
var progression = 0; | |
while (salary > 0) |
This file contains hidden or 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 System; | |
using System.Collections.Generic; | |
using System.IO; | |
using FluentNHibernate; | |
using FluentNHibernate.AutoMap; | |
using FluentNHibernate.Cfg.Db; | |
using NHibernate; | |
using NHibernate.Cfg; | |
using NHibernate.Context; | |
using NHibernate.Event; |
This file contains hidden or 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
import os, shlex, subprocess, re, datetime | |
class MsBuilder: | |
def __init__(self, msbuild=None, mstest=None, nuget=None, trx2html=None): | |
# The following dictionary holds the location of the various | |
# msbuild.exe paths for the .net framework versions | |
if msbuild==None: | |
self.msbuild = r'C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe' | |
else: | |
self.msbuild = msbuild |
This file contains hidden or 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 UserSession:IUserSession{ | |
private readonly IAuthenticationService _authenticationService; | |
private readonly ICryptographer _crypto; | |
private readonly IUserRepository _repository; | |
public UserSession(IUserRepository repository,IAuthenticationService authenticationService,ICryptographer crypto){ | |
Guard.AgainstNull(repository); | |
Guard.AgainstNull(authenticationService); | |
Guard.AgainstNull(crypto); | |
_repository=repository; | |
_crypto=crypto; |