Skip to content

Instantly share code, notes, and snippets.

View vijayantkatyal's full-sized avatar
🙃

Vijayant Katyal vijayantkatyal

🙃
View GitHub Profile
@vijayantkatyal
vijayantkatyal / git-folders
Created April 16, 2015 20:32
git add sub folders / current folder
#include current folder only
git add *.png
# include sub folders only
git add **/*.png
# include both current and sub folders
git add *.png
git add **/*.png
@vijayantkatyal
vijayantkatyal / convert-mogrify
Last active August 29, 2015 14:19
convert | batch convert ai to png
# single convert
convert -density 150 File.ai preview.png
# batch convert
dir -recurse -include *.ai | %{ mogrify -density 150 -format png $_.FullName }
# run as powershell command (wrap)
powershell -Command 'dir -recurse -include *.ai | %{ mogrify -density 150 -format png $_.FullName }'
public static class DbContextExtensions
{
public static void LogToConsole(this DbContext context)
{
IServiceProvider contextServices = ((IDbContextServices)context).ScopedServiceProvider;
var loggerFactory = contextServices.GetRequiredService<ILoggerFactory>();
loggerFactory.AddConsole(LogLevel.Verbose);
}
}
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"