This file contains hidden or 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 WebAPI | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
// Batasi maksimal thread jadi sesuai dengan jumlah CPU | |
var processorCounter = Environment.ProcessorCount; | |
ThreadPool.SetMaxThreads( | |
processorCounter, |
This file contains hidden or 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
const daftarSupir: Array<any> = [] | |
function supir({ nama, mobil }: { nama: string, mobil: string }) { | |
return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) { | |
daftarSupir.push({ nama, mobil, propertyKey, target }) | |
}; | |
} | |
function timeout(ms: number) { | |
return new Promise(resolve => setTimeout(resolve, ms)); |
This file contains hidden or 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
var emailChannel chan *viewmodels.EmailMessage | |
var emailChannelClosed bool | |
func SendMessage(message *viewmodels.EmailMessage) { | |
emailChannel <- message | |
} | |
func Open() { | |
emailChannel = make(chan *viewmodels.EmailMessage) |
This file contains hidden or 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
#!/bin/bash | |
if ! pgrep -f 'binary_app' | |
then | |
nohup /home/file_path/binary_app && echo "baru running" > ./out_test.txt | |
else | |
echo "udah di-run" > ./out_test.txt | |
fi |
This file contains hidden or 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
/** | |
* Middleware Handle JWT in Cookie | |
* @author Mufid Jamaluddin | |
**/ | |
namespace IssueTracker.Middleware | |
{ | |
public static class JwtInCookieMiddleware | |
{ | |
public const string JWT_COOKIE_KEY = "token"; |
This file contains hidden or 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 IssueTracker | |
{ | |
public class Startup | |
{ | |
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IssueTrackerDbContext dbContext, ILoggerFactory loggerFactory) | |
{ | |
if (env.IsDevelopment()) | |
{ | |
app.UseDeveloperExceptionPage(); |
This file contains hidden or 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 IssueTracker.Controller | |
{ | |
[Route("api/[controller]")] | |
public class TicketController : Controller | |
{ | |
private ITicketServices TicketServices { get; } | |
public TicketController(ITicketServices TicketServices) | |
{ | |
this.TicketServices = TicketServices; |
This file contains hidden or 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 IssueTracker | |
{ | |
public class Startup | |
{ | |
public virtual void ConfigureDatabase(IServiceCollection services) | |
{ | |
if (!int.TryParse(Configuration["DatabasePool"], out int dbPoolSize)) | |
{ | |
dbPoolSize = DEFAULT_MAX_POOL_SIZE; | |
} |
This file contains hidden or 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 IssueTracker.Services | |
{ | |
public class TicketServices : ITicketServices | |
{ | |
private ITicketRepository TicketRepository { get; } | |
private ITransactionRepository TransactionRepository { get; } | |
private ILogger<TicketServices> Logger { get; } | |
private IssueTrackerDbContext DbContext { get; } | |
public TicketServices() |
This file contains hidden or 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
@Entity | |
@Audited | |
class Student extends Serializable | |
{ | |
@Version | |
private Integer version; | |
String NISN; | |
String fullName; | |
Float GPA; |
NewerOlder