Skip to content

Instantly share code, notes, and snippets.

View elendil-software's full-sized avatar

Julien Tschäppät elendil-software

View GitHub Profile
@anvk
anvk / psql_useful_stat_queries.sql
Last active March 8, 2024 12:05
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- 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
@maxim
maxim / gh-dl-release
Last active March 3, 2024 07:09
Download assets from private Github releases
#!/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.
#
# PREREQUISITES
#
@belaw
belaw / fork.reg
Last active February 29, 2024 07:35
Fork Git Client Windows Explorer Integration
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\directory\background\shell\git_fork]
@="Open in &Fork"
"Icon"=hex(2):25,00,4c,00,4f,00,43,00,41,00,4c,00,41,00,50,00,50,00,44,00,41,\
00,54,00,41,00,25,00,5c,00,46,00,6f,00,72,00,6b,00,5c,00,46,00,6f,00,72,00,\
6b,00,2e,00,65,00,78,00,65,00,2c,00,30,00,00,00
[HKEY_CLASSES_ROOT\directory\background\shell\git_fork\command]
@=hex(2):22,00,25,00,4c,00,4f,00,43,00,41,00,4c,00,41,00,50,00,50,00,44,00,41,\
@henriquemoody
henriquemoody / http-status-codes.php
Last active January 26, 2024 10:29
List of HTTP status codes in PHP
<?php
/**
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
*
* You may also want a list of unofficial codes:
*
* 103 => 'Checkpoint',
* 218 => 'This is fine', // Apache Web Server
* 419 => 'Page Expired', // Laravel Framework
@fernandohu
fernandohu / Reading configuration files before application startup in Angular2 final release.md
Last active May 8, 2023 16:40
Reading configuration files before application startup in Angular2 final release

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'.

@changhuixu
changhuixu / CronJobService.cs
Last active December 14, 2022 14:01
schedule cron job. IHostedService, asp.net core
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;
@anuraj
anuraj / winservice.iss
Created January 28, 2017 09:01
Innosetup script file for dotnet core windows service installation
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "dotnet core windows service"
#define MyAppVersion "1.5"
#define MyAppPublisher "dotnetthoughts"
#define MyAppURL "http://dotnetthoughts.net/"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
@alexeyzimarev
alexeyzimarev / JsonNetRestSharp.cs
Created December 30, 2018 21:08
Using Newtonsoft.Json with RestSharp v106.6
using Newtonsoft.Json;
using RestSharp;
using RestSharp.Serialization;
namespace JsonNetRestSharp
{
class Program
{
static void Main(string[] args)
{
@kseo
kseo / Option.cs
Created January 19, 2015 07:00
Step by step implementation of Option type in C#
using System;
namespace Option
{
public abstract class Option<T>
{
public abstract T Value { get; }
public abstract bool IsSome { get; }