Skip to content

Instantly share code, notes, and snippets.

View enverarslan's full-sized avatar
🦇
It's not who I am underneath, but what I do that defines me.

Enver Arslan enverarslan

🦇
It's not who I am underneath, but what I do that defines me.
View GitHub Profile
@enverarslan
enverarslan / Repository.cs
Created July 7, 2022 23:59 — forked from antdimot/Repository.cs
Example of mongodb repository in C#
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.Builders;
@enverarslan
enverarslan / mongodb_c#_cheatsheet.md
Created November 7, 2021 21:48 — forked from a3dho3yn/mongodb_c#_cheatsheet.md
MongoDB C# Driver Cheat Sheet

MongoDB C# Driver Cheat Sheet

(C) 2015 by Derek Hunziker, (C) 2017 by AppsOn

As of releasing MongoDB 3.4 and C# Driver v2.4, original cheatsheet by Derek is outdated. In addition, it has some deficiencies like connecting to MongoDB, creating indexes, etc. This updated version works fine with C# Driver v2.4.7 and MongoDB v3.4.

Setup

Define Document Models

Note: Defined models and collections will be used in entire cheatsheet.

name: Build & deploy
on:
push:
branches:
- main
pull_request:
branches:
- main
@enverarslan
enverarslan / Laravel-Container.md
Created November 22, 2020 22:40
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

@enverarslan
enverarslan / concurrent-image-download.js
Last active December 15, 2019 05:48
Bulk image download without network errors by concurrent connections with promises in Node.js
const https = require('https'),
fs = require('fs'),
Promise = require('bluebird').Promise;
let getImage = (image) => {
let filename = image.split('/').pop();
let options = new URL(image);
options.timeout = 5000;
options.agent = new https.Agent({keepAlive: true});
@enverarslan
enverarslan / urls.txt
Created October 28, 2019 19:06 — forked from gkmngrgn/urls.txt
My Feeds
http://lucumr.pocoo.org/feed.atom "Python" "Rust" # Armin Ronacher
http://feeds.feedburner.com/ScottHanselman "Csharp" # Scott Hanselman
https://www.joelonsoftware.com/feed/ "Csharp" # Joel Spolsky
http://www.norvig.com/rss-feed.xml "Python" # Peter Norvig
http://nicktasios.nl/rss.xml "Cpp" # Nick Tasios
http://feeds.feedburner.com/SolarianProgrammer "Cpp" # Paul Silisteanu
https://alexgaynor.net/feed.xml "Python" "Rust" # Alex Gaynor
http://feeds.feedburner.com/codinghorror?format=xml "Csharp" # Jeff Atwood
https://drewdevault.com/feed.xml "Golang" # Drew DeVault
http://dave.cheney.net/feed

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

http://stackoverflow.com/questions/19386962/laravel-eloquent-and-complex-relationships?rq=1
http://forumsarchive.laravel.io/viewtopic.php?pid=21255
http://stackoverflow.com/questions/20666490/laravel-4-mssql-stored-procedure-with-parameters-as-a-prepared-statements
http://culttt.com/2013/08/05/extending-eloquent-in-laravel-4/
http://www.blogosfera.co.uk/2013/08/pass-parameters-in-insert-query-stored-procedure-in-laravel-4/