Skip to content

Instantly share code, notes, and snippets.

View bariscanyilmaz's full-sized avatar
😃
I like computers

Barış Can Yılmaz bariscanyilmaz

😃
I like computers
View GitHub Profile
//Fire-and-Forget
BackgroundJob.Enqueue(()=>Console.WriteLine("Fire-and-Forget "));
//Recurring
RecurringJob.AddOrUpdate(()=>Console.WriteLine("Recurring "),Cron.Daily);
//Delayed Jobs
var jobId= BackgroundJob.Schedule(()=>Console.WriteLine("10 seconds Delayed"),TimeSpan.FromSeconds(10));
//Continuations
GlobalConfiguration.Configuration
.SetDataCompatibilityLevel(CompatibilityLevel.Version_170)
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
.UseSqlServerStorage(@"Server=.\SQLEXPRESS;Database=Hangfire.Sample; Integrated Security=True;");
@bariscanyilmaz
bariscanyilmaz / Crawler.cs
Created October 29, 2019 10:58
YtuYemekhane_TelegramBot'u crawler kodu.
using System;
using HtmlAgilityPack;
namespace YtuYemekhane_TelegramBot
{
class Program
{
const string crawlUri=@"http://www.sks.yildiz.edu.tr";
static void Main(string[] args)
module.exports=(arg)=>{
const str= arg.toString();
let newStr="";
for (let index = str.length-1; index >= 0; index--) {
newStr += str[index];
}
return newStr;
}
<div class="book-form-categories" formArrayName="bookCategories"
*ngFor="let item of addBookForm.get('bookCategories')['controls']; let i = index;">
<mat-form-field [formGroupName]="i" class="book-form-category">
<mat-label>Book Category</mat-label>
<mat-select formControlName="bookCategory" required>
<mat-option *ngFor="let category of data" [value]="category.Name">
{{category.Name}}
</mat-option>
</mat-select>
</mat-form-field>
import { Component, OnInit, Inject } from '@angular/core';
import { FormGroup, FormBuilder, FormControl, FormArray } from '@angular/forms';
import { Category } from 'src/app/models/category.model';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
import { BookService } from 'src/app/services/book.service';
import { Book } from 'src/app/models/book.model';
@Component({
selector: 'app-addbook-dialog',
templateUrl: './addbook-dialog.component.html',
<div mat-dialog-content class="book-dialog-content">
<form [formGroup]="addBookForm" class="add-book-form">
<mat-form-field>
<input formControlName="bookName" matInput placeholder="Book Name" required >
</mat-form-field>
<mat-form-field>
<input matInput formControlName="bookAuthor" placeholder="Book Author" required>
</mat-form-field>
<div class="container">
<div class="category-list">
<mat-button-toggle-group #categoryGroup="matButtonToggleGroup">
<mat-button-toggle [value]="category.Name" *ngFor="let category of categories">
{{category.Name}}
</mat-button-toggle>
</mat-button-toggle-group>
</div>
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { BookService } from './services/book.service';
import { Book } from './models/book.model';
import { CategoryService } from './services/category.service';
import { Category } from './models/category.model';
import { SwalComponent } from '@sweetalert2/ngx-sweetalert2';
import { MatDialog } from '@angular/material/dialog';
import { BookDialogComponent } from './components/book-dialog/book-dialog.component';
import { AddbookDialogComponent } from './components/addbook-dialog/addbook-dialog.component';
import { AddcategoryDialogComponent } from './components/addcategory-dialog/addcategory-dialog.component';
import { AngularFirestore, AngularFirestoreCollection } from '@angular/fire/firestore';
import { Injectable } from '@angular/core';
import { Book } from "../models/book.model";
import { Category } from '../models/category.model';
@Injectable({
providedIn: 'root'
})
export class BookService {