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
# Trim a set of permissions properties off of our model: | |
clone = @.omit _.filter @.keys, (key) -> !key.indexOf 'can_' |
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
// use this on any page with fartscroll -> http://theonion.github.io/fartscroll.js/ | |
setInterval((function() { | |
var rangeUpper = 100; | |
$("body").fartscroll(100); | |
return function() { | |
var randomnumber = Math.floor( Math.random() * rangeUpper ), | |
mod = 1; | |
if( $(document).height() - $(window).scrollTop() - $(window).height() <= 0 ) { | |
mod = -1; | |
} |
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
var hitBy = WeaponManager.CheckIfHit( this ); | |
if( hitBy != null ) | |
{ | |
Hud.KillStreak = 0; | |
var damageAfterShields = Shields.AbsorbDamage( hitBy.Damage ); | |
// huh, this is a bug. Looks like you won't take damage if you have less shields than weapon damage | |
if( damageAfterShields == hitBy.Damage ) | |
{ |
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
(function($) { | |
$('.validation_error').each(function( index ) { | |
var $item = $(this); | |
var $control = $item.closest('tr').find('.EditingFormControlNestedControl').first(); | |
$item.attr('id', control.id); | |
this.id = control.id; | |
}); | |
})(jQuery); |
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 System.Runtime.Serialization; | |
using System.Runtime.Serialization.Json; | |
using FragEngine.Entities; | |
using FragEngine.IO; | |
using Microsoft.Xna.Framework; | |
namespace ThunderDome |
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
// function to mark a field invalid in one of our backbone viewws (uses backbone.validation) | |
function markFieldInvalid (view, attr, error) { | |
view.getFieldByName(attr) | |
.addClass('invalid') | |
.parents('.control-group:first') | |
.addClass('error') | |
.find('.help-inline, .help-block') | |
.text(error); | |
}; |
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
var DISQUSWIDGETS, disqus_domain, disqus_shortname; | |
typeof DISQUSWIDGETS == "undefined" && (DISQUSWIDGETS = function () { | |
var c = {}, m = document.getElementsByTagName("HEAD")[0] || document.body, | |
n = 0, | |
h = {}, k = { | |
identifier: 1, | |
url: 2, | |
slug: 3 | |
}; | |
c.domain = "disqus.com"; |
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
[PetaPoco.TableName("People")] | |
[PetaPoco.PrimaryKey("Id")] | |
public class Person | |
{ | |
public int Id { get; set; } | |
// .. some other fields | |
} | |
public ActionResult Create( Person person ) | |
{ |
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.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
using Proggr.Controllers.Filters; | |
using Proggr.Controllers.Responses; | |
namespace Proggr.Controllers | |
{ |