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
namespace Sparrow.Migrations | |
{ | |
using System; | |
using System.Data.Entity.Migrations; | |
using System.IO; | |
public abstract class ScriptMigration : DbMigration | |
{ | |
public string MigrationsDir | |
{ |
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 IValidationResult<Relationship> Update(Relationship relationship, IUser author) | |
{ | |
repository.Attach(relationship); | |
relationship.UpdaterId = author.Id; | |
relationship.DeactivatedAt = DateTime.Now; | |
if (relationship.IsActive) | |
relationship.IsActive = 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
public IValidationResult<Relationship> Update(Relationship relationship, IUser author) | |
{ | |
repository.Attach(relationship); | |
relationship.UpdaterId = author.Id; | |
relationship.DeactivatedAt = DateTime.Now; | |
if (relationship.IsActive) | |
relationship.IsActive = 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
// Instructions: | |
// 1. Navigate to you GitHub dashboard, either (https://github.com or https://github.com/organizations/{org_name} | |
// 2. Click on "All repositories" or "Show N more repositories" to show all your repos | |
// 3. Open Firebug console, and paste this script. Optionally, change the options below | |
// 4. Run and have fun | |
var options = { | |
origin: "all", // can be: source, fork or all | |
visibility: "all", // can be: public, private or all | |
showInNewWindow: true |
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
## | |
# the ImportOnce importer itself | |
# colorize is used for colorized terminal output, useful for debugging, but you can strip that off | |
## | |
require 'colorize' | |
module Sass | |
module Importers | |
class ImportOnce < Filesystem |
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
Mapper.CreateMap<Design, DesignSubmitViewModel>() | |
.ForMember(d => d.Tags, opt => opt.MapFrom(d => d.Tags.Aggregate("", (total, tag) => total + (tag.Name + ", ")).Trim(' ',','))); | |
Mapper.CreateMap<DesignSubmitViewModel, Design>() | |
.ForMember(d => d.Competition, opt => opt.Ignore()) | |
.ForMember(d => d.Tags, opt => opt.MapFrom(d => d.Tags.Split(',').Select(name => new Tag() { Name = name.Trim() }))); |
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
/* Font Awesome | |
the iconic font designed for use with Twitter Bootstrap | |
------------------------------------------------------- | |
The full suite of pictographic icons, examples, and documentation | |
can be found at: http://fortawesome.github.com/Font-Awesome/ | |
License | |
------------------------------------------------------- | |
The Font Awesome webfont, CSS, and LESS files are licensed under CC BY 3.0: | |
http://creativecommons.org/licenses/by/3.0/ A mention of |
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
Image image = Image.FromStream(file.InputStream); | |
var path = Server.MapPath("~/App_Data/Files"); | |
image.Save(Path.Combine(path, Path.GetFileName("test.png")), System.Drawing.Imaging.ImageFormat.Png); |
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
void WriteProperty(CodeGenerationTools code, EdmProperty edmProperty) | |
{ | |
var type = code.Escape(edmProperty.TypeUsage); | |
if((type == "byte" || type == "Nullable<byte>" || type == "byte?") && code.Escape(edmProperty).ToLower().StartsWith("is")) | |
{ | |
var name = code.Escape(edmProperty); | |
name = "_" + Char.ToLower(name[0]) + name.Substring(1); | |
#> | |
private <#=type#> <#=name#> { get; set; } |
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
#!/bin/sh | |
repo="https://github.com/theblacksmith/yii-boilerplate.git" | |
project="" | |
template="" | |
function usage | |
{ | |
echo "\nYii-boilerplate (by theblacksmith)\n\n" | |
echo "Usage:" |