Skip to content

Instantly share code, notes, and snippets.

View rusith's full-sized avatar
🏠
Working from home

Shanaka Rusith rusith

🏠
Working from home
View GitHub Profile
@rusith
rusith / mandelbrot.html
Created September 30, 2022 12:09
Mandelbrot.html
<html>
<canvas id="display" width="1000" height="1000"></canvas>
<script>
const canvas = document.getElementById('display')
.getContext('2d');
const atom = (x, y, c) => {
@rusith
rusith / genie-blog-post-user-provider.cs
Last active February 4, 2018 01:19
Genie Blog Post - User Provider
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using BestAppEver.DAL.Infrastructure.Interfaces;
using BestAppEver.DAL.Infrastructure.Models.Concrete;
using BestAppEver.Models.Data;
using BestAppEver.Providers.Data;
namespace BestAppEver.DAL.Providers
{
@rusith
rusith / genie-blog-post-di.cs
Created February 3, 2018 12:15
Genie Blog Post - DI
using BestAppEver.Injection;
using BestAppEver.DAL.Infrastructure.Interfaces;
using BestAppEver.DAL.Infrastructure;
namespace BestAppEver.DAL.Modules
{
public class DataAccessModule : IModule
{
public void Bootstrap(IDependencyStore store)
{
@rusith
rusith / genie-blog-post-iconnectionstrinprovider-implementation.cs
Created February 3, 2018 12:12
Genie Blog post - IConnectionStringProvider Implementation
using BestAppEver.DAL.Infrastructure.Interfaces;
namespace BestAppEver.DAL
{
public class ConnectionProvider : IConnectionStringProvider
{
public string GetConnectionString()
{
return "Server=localhost;Database=bestappdata;UID=root;Password=password"; // Should be taken from a configuration file
}
@rusith
rusith / genie-blog-post-dal-structure.txt
Created February 3, 2018 11:46
Genie Blog Post - DAL folder
β”œβ”€β”€ Dapper
β”œβ”€β”€ Infrastructure
β”‚Β Β  β”œβ”€β”€ Actions
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ Abstract
β”‚Β Β  β”‚Β Β  └── Concrete
β”‚Β Β  β”œβ”€β”€ Collections
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ Abstract
β”‚Β Β  β”‚Β Β  └── Concrete
β”‚Β Β  β”œβ”€β”€ Enum
β”‚Β Β  β”œβ”€β”€ Filters
@rusith
rusith / genie-blog-post-directory-structure.txt
Last active February 3, 2018 11:43
Genie Blog Post - Project Directory Structure
β”œβ”€β”€ BestAppEver
β”‚Β Β  β”œβ”€β”€ Modules
β”œβ”€β”€ BestAppEver.API
β”‚Β Β  β”œβ”€β”€ Controllers
β”œβ”€β”€ BestAppEver.BL
β”‚Β Β  β”œβ”€β”€ Services
β”œβ”€β”€ BestAppEver.DAL
β”‚Β Β  β”œβ”€β”€ Modules
β”‚Β Β  └── Providers
└── BestAppEver.UnitTests
@rusith
rusith / genie-blog-post-genieSettings.json
Created February 3, 2018 11:02
Genie Blog Post - Configuration
{
"connectionString":
"Server=localhost;Database=bestappdata;UID=root;Password=password",
"projectPath": "/home/rusith/Documents/Projects/BestAppEver/BackEnd/BestAppEver.DAL",
"baseNamespace": "BestAppEver.DAL",
"ProjectFile": "BestAppEver.DAL.csproj",
"dbms": "mysql",
"schema": "animus",
"abstractModelsLocation": "./../BestAppEver/Models/Data",
"abstractModelsNamespace": "BestAppEver.Models.Data"
@rusith
rusith / imagemagick-install-steps
Created January 15, 2018 07:49 — forked from rodleviton/imagemagick-install-steps
Installing Image Magick on Ubuntu 14.04
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
wget http://www.imagemagick.org/download/ImageMagick-6.8.7-7.tar.gz
tar xzvf ImageMagick-6.8.9-1.tar.gz
cd ImageMagick-6.8.9-1/
./configure --prefix=/opt/imagemagick-6.8 && make
checkinstall
switch (type.ToLower())
{
case "equals":
case "eq":
return QueryMaker.EqualsTo(propName, value, quoted);
case "notequals":
case "neq":
case "ne":
return QueryMaker.NotEquals(propName, value, quoted);
case "contains":
...
var repo = unit.InvoicesViewRepository;
var filter = repo.Get()
.OrderBy.ModifiedDate.Ascending().Order();
...