Skip to content

Instantly share code, notes, and snippets.

Ed Charbeneau EdCharbeneau

Block or report user

Report or block EdCharbeneau

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Prototyping Examples
@using Prototyping.Ipsum;
@using Prototyping.Placeholdit;
//Ipsum examples
//Random paragraph
@Html.Ipsum()
//Paragraph
@Html.Ipsum().p()
//Four paragraphs, ten sentences
@Html.Ipsum().p(4, 10)
//Paragraph with the attribute class="fancy"
@EdCharbeneau
EdCharbeneau / OrbitNavToggle.js
Created Aug 21, 2012
Hide/Show orbit nav with jQuery
View OrbitNavToggle.js
//must wrap the orbit element in a div
// wrapper > orbit
$(window).load(function () {
$('#orbit').orbit({
timer: true,
animation: 'horizontal-slide',
bullets: true
});
$('#wrapper .slider-nav').hide();
});
@EdCharbeneau
EdCharbeneau / Add options to dropdown
Created Oct 3, 2013
The correct way to add items to an Html drop down list using jQuery.
View Add options to dropdown
optionsToAdd.forEach(function (item) {
$("<option></option>")
.html(item.myText)
.attr("value", item.myId)
.appendTo($("#targetDropDown"));
})
@EdCharbeneau
EdCharbeneau / Reflection less interface methods
Created Oct 3, 2013
@MLaritz: anyone know if there's a way to find in a class that implements an interface, all the public methods that aren't part of the interface? #vs
View Reflection less interface methods
var targetType = typeof(Target);
targetType.GetMethods()
.Select(m => m.Name)
.Except(targetType.GetInterfaces()
.SelectMany(i => i.GetMethods()
.Select(im => im.Name)))
//---out
//ScoreGame
@EdCharbeneau
EdCharbeneau / CustomTextBoxFor
Last active Dec 24, 2015
Extending the TextBoxFor helper
View CustomTextBoxFor
public static MvcHtmlString CustomTextBoxFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper,
Expression<Func<TModel, TProperty>> expression, string customData)
{
return htmlHelper.CustomTextBoxFor(expression, customData, (IDictionary<string, object>)null);
}
public static MvcHtmlString CustomTextBoxFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper,
Expression<Func<TModel, TProperty>> expression, string customData, object htmlAttributes)
{
IDictionary<string, object> attributes = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes);
@EdCharbeneau
EdCharbeneau / RevealingModule stub
Last active Dec 25, 2015
Revealing module pattern stub
View RevealingModule stub
var module = function () {
//private
var someFunction = function(message){ ... },
privateFunction = function() { ... }
onInit = function(settings) { ... };
return {
//public
init: onInit
publicFunction: someFunction
@EdCharbeneau
EdCharbeneau / Close Foundation Reveal
Created Oct 29, 2013
Foundation Reveal. Quickly add a second close button globally (to any number of modal dialog boxes).
View Close Foundation Reveal
$(document).foundation('reveal', {
//replace .secondary-close-reveal-modal with the class name of any element or button
dismissModalClass: 'close-reveal-modal, .secondary-close-reveal-modal'
})
@EdCharbeneau
EdCharbeneau / Visual Studio Extensions
Last active Dec 28, 2015
Must have extensions for Visual Studio 2013
View Visual Studio Extensions
#Must have extensions for Visual Studio 2013
- [Entity Framework Power Tools (Beta)](http://msdn.microsoft.com/en-US/data/jj593170)
- [Git Diff Margin](http://visualstudiogallery.msdn.microsoft.com/cf49cf30-2ca6-4ea0-b7cc-6a8e0dadc1a8)
- [JavaScript Parser](https://code.google.com/p/js-addin/)
- [Web Essentials 2013](http://vswebessentials.com/)
- [Productivity Power Tools 2013](http://visualstudiogallery.msdn.microsoft.com/dbcb8670-889e-4a54-a226-a48a15e4cace?SRC=Home)
- [SideWaffle](http://t.co/MQXzCMPoVK)
# Nuget Packages
View modern-scale.scss
// --------------------------------------------------------------------------------------
// A More Modern Scale for Web Typography
// Based on this article: http://typecast.com/blog/a-more-modern-scale-for-web-typography
// --------------------------------------------------------------------------------------
$body-font-size: 1em !default;
// Adjusts body typography to be default
// for each browser.
@mixin reset-body-font-size($size: 100%, $size-adjustment: 0.5) {
View ruby-warrior.rb
class Player
def initialize
@max_health = 20
@last_health = 20
@critical_health = 10
@direction = :forward
end
def play_turn(warrior)
You can’t perform that action at this time.