Skip to content

Instantly share code, notes, and snippets.

belaw / fork.reg
Last active Aug 7, 2021
Fork Git Client Windows Explorer Integration
View fork.reg
Windows Registry Editor Version 5.00
@="Open in &Fork"
changhuixu / CronJobService.cs
Last active Sep 3, 2021
schedule cron job. IHostedService, core
View CronJobService.cs
public abstract class CronJobService : IHostedService, IDisposable
private System.Timers.Timer _timer;
private readonly CronExpression _expression;
private readonly TimeZoneInfo _timeZoneInfo;
protected CronJobService(string cronExpression, TimeZoneInfo timeZoneInfo)
_expression = CronExpression.Parse(cronExpression);
_timeZoneInfo = timeZoneInfo;
alexeyzimarev / JsonNetRestSharp.cs
Created Dec 30, 2018
Using Newtonsoft.Json with RestSharp v106.6
View JsonNetRestSharp.cs
using Newtonsoft.Json;
using RestSharp;
using RestSharp.Serialization;
namespace JsonNetRestSharp
class Program
static void Main(string[] args)
anvk / psql_useful_stat_queries.sql
Last active Sep 22, 2021
List of some useful Stat Queries for PSQL
View psql_useful_stat_queries.sql
--- PSQL queries which also duplicated from
--- some of them taken from
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
-- Basics --
-- Get indexes of tables
anuraj / winservice.iss
Created Jan 28, 2017
Innosetup script file for dotnet core windows service installation
View winservice.iss
; Script generated by the Inno Setup Script Wizard.
#define MyAppName "dotnet core windows service"
#define MyAppVersion "1.5"
#define MyAppPublisher "dotnetthoughts"
#define MyAppURL ""
; NOTE: The value of AppId uniquely identifies this application.
fernandohu / Reading configuration files before application startup in Angular2 final
Last active Jul 24, 2021
Reading configuration files before application startup in Angular2 final release
View Reading configuration files before application startup in Angular2 final

Reading data before application startup in Angular 2

In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.

This is how the demonstration will load data:

a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';

b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.

maxim / gh-dl-release
Last active Sep 21, 2021
Download assets from private Github releases
View gh-dl-release
#!/usr/bin/env bash
# gh-dl-release! It works!
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
kseo / Option.cs
Created Jan 19, 2015
Step by step implementation of Option type in C#
View Option.cs
using System;
namespace Option
public abstract class Option<T>
public abstract T Value { get; }
public abstract bool IsSome { get; }
henriquemoody / http-status-codes.php
Last active Sep 8, 2021
List of HTTP status codes in PHP
View http-status-codes.php
* Content from
* You may also want a list of unofficial codes:
* 103 => 'Checkpoint',
* 218 => 'This is fine', // Apache Web Server
* 419 => 'Page Expired', // Laravel Framework