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
using configs; | |
using databases.models; | |
using Microsoft.EntityFrameworkCore; | |
namespace databases.contexts | |
{ | |
public class ProjectContext : DbContext | |
{ | |
public DbSet<CompanyModel>? companies { get; set; } | |
public DbSet<InvoiceModel>? invoices { 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
<!doctype html> | |
<html> | |
<head> | |
<title>Invoice</title> | |
<script src="angular.min.js"></script> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<link rel="stylesheet" href="w3.css" /> | |
</head> | |
<body ng-app="ReportsApp" ng-controller="InvoiceController"> | |
<div> |
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
int nominator = Nominiators.FOUR; | |
int denominator = Denominators.FOUR; | |
int tempo = Tempos.ONEFOURTY; | |
FileInfo fi = new FileInfo(filename); | |
string pattern = @"^filename-(\d+)-(\d+)-(\d+)\.txt$"; | |
Regex re = new Regex(pattern); | |
Match chunks = re.Match(fi.Name); | |
if(chunks.Groups.Count == 4) |
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 dtos { | |
public class EmployeesDTO { | |
public string employee_id { get; set; } | |
public string employee_code { get; set; } | |
public string employee_title { get; set; } | |
public string employee_name { get; set; } | |
public string employee_email { get; set; } | |
public string employee_phone { get; set; } | |
public string employee_address { get; set; } | |
public string is_visible { 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
RestClient client = new RestClient(configs.login); | |
RestRequest request = new RestRequest("/api/login/", DataFormat.Json); | |
request.AddHeader("Content-Type", "application/json"); | |
request.AddJsonBody(login); | |
IRestResponse response = client.Execute(request, Method.POST); | |
SuccessDTO attempt = JsonConvert.DeserializeObject<SuccessDTO>(response.Content); | |
return attempt.status; |
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
import sqlite3 | |
import uuid | |
""" | |
CREATE TABLE "users" ( | |
"user_id" TEXT NOT NULL, | |
"user_email" TEXT NOT NULL UNIQUE, | |
"user_password" TEXT NOT NULL, | |
PRIMARY KEY("user_id") | |
); |
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
[web] | |
comment = PHP Web Directory | |
path = /var/www/html | |
browseable = yes | |
create mask = 0777 | |
directory mask = 0777 | |
follow symlinks = yes | |
only guest = no | |
public = no | |
wide links = yes |
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
{ | |
"require": { | |
"anytizer/guid.php": "dev-master", | |
"illuminate/database": "^5.7", | |
"illuminate/events": "^5.7", | |
"illuminate/container": "^5.7", | |
"illuminate/contracts": "^5.6", | |
} | |
} |
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
<?php | |
if($_SERVER["REQUEST_METHOD"] === "OPTIONS") | |
{ | |
header("Access-Control-Allow-Origin: *"); | |
header("Access-Control-Allow-Methods: GET, POST"); | |
header("Access-Control-Allow-Headers: X-Protection-Token"); | |
die(); | |
} |
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
// paint handler | |
private void fForm_Paint(object sender, PaintEventArgs e) | |
{ | |
Pen redPen = new Pen(Color.Red, 1.0F); | |
PointF p1 = new PointF(20.0F, 50.0F); | |
PointF p2 = new PointF(200.0F, 50.0F); | |
e.Graphics.DrawLine(redPen, p1, p2); | |
} |