Skip to content

Instantly share code, notes, and snippets.

View thedersen's full-sized avatar

Thomas Pedersen thedersen

  • Ålesund, Norway
View GitHub Profile
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 16,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
@thedersen
thedersen / Backbone.Validation
Created July 27, 2012 19:11
Validation dependent on other attribute
var Model = Backbone.Model.extend({
validation: {
dependsOn: function(value, attributeName, computedState) {
// computedState is the model's state after the current operation completes.
// You need to get the value of the other attribute from this, and not from the
// model it self because if both attributes are being set at the same time,
// model's value is not yet updated.
if(computedState.someAttribute === 'someValue') {
@thedersen
thedersen / thedersen.vssettings
Created November 1, 2011 10:43
My VS color scheme
<UserSettings>
<ApplicationIdentity version="10.0"/>
<ToolsOptions>
<ToolsOptionsCategory name="Environment" RegisteredName="Environment"/>
</ToolsOptions>
<Category name="Database Tools" RegisteredName="Database Tools"/>
<Category name="Environment_Group" RegisteredName="Environment_Group">
<Category name="Environment_FontsAndColors" Category="{1EDA5DD4-927A-43a7-810E-7FD247D0DA1D}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_FontsAndColors" PackageName="Visual Studio Environment Package">
<PropertyValue name="Version">2</PropertyValue>
<FontsAndColors Version="2.0">
Get["/embedded"] = x => {
var model = new RatPack { FirstName = "Embedded" };
return View[model];
};
// in the view factory
public Action<Stream> this[dynamic model]
{
get { return this.GetRenderedView(model.GetType().Name, model); }
}
# Remove stuff we don't want
run "rm public/index.html"
run "rm public/images/rails.png"
# Add jQuery
run "curl http://code.jquery.com/jquery-1.4.2.min.js > public/javascripts/jquery-1.4.2.min.js"
run "curl http://github.com/rails/jquery-ujs/raw/master/src/rails.js > public/javascripts/rails.js"
# Create a readme file
run "echo TODO: Explain yourself! > README.md"
/// <summary>
/// FBId
/// </summary>
/// <param name="__">List</param>
/// <param name="___">Booking</param>
/// <returns>ID</returns>
internal int FBId(ArrayList __,IWBSBooking ___)
{
int ____=-1;if(__!=null&&___!=null)foreach(IWBSBooking _ in __){if((_.CreatedUser_Id==___.CreatedUser_Id)&&(_.CreatedDateTime==___.CreatedDateTime)&&(_.StartDateTime==___.StartDateTime)&&(_.EndDateTime==___.EndDateTime)&&(WSys.BitFlag.CheckFlag(_.Flag,(int)(0x01 << 5)))){return _.WBSBookingID;}}return ____;
}
public interface IPresenter
{
void Initialize();
object UI { get; }
}
public class Prescription
{
public DateTime? CeasedAt { get; set; }
}
public class BlogService
{
private Repository _repository;
public BlogService()
{
_repository = new Repository();
}
public void ProcessComment(Comment comment)
public partial class Form : System.Windows.Forms.Form
{
public Form()
{
InitializeComponent();
}
private void buttonStart_Click(object sender, EventArgs e)
{
StartAsyncJob();