Skip to content

Instantly share code, notes, and snippets.

View divyang4481's full-sized avatar
💭
I may be slow to respond.

Divyang Panchasara divyang4481

💭
I may be slow to respond.
View GitHub Profile
@nginx-gists
nginx-gists / api_backends.conf
Last active September 26, 2025 04:25 — forked from lcrilly/api_backends.conf
Deploying NGINX Plus as an API Gateway, Part 1
upstream warehouse_inventory {
zone inventory_service 64k;
server 10.0.0.1:80;
server 10.0.0.2:80;
server 10.0.0.3:80;
}
upstream warehouse_pricing {
zone pricing_service 64k;
server 10.0.0.7:80;
@JannieT
JannieT / droid_set_version.targets
Last active January 25, 2019 12:02
Xamarin Multiplatform App Version Synchronization
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Increment" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<Number ParameterType="System.Int64" Required="true"/>
<Incremented ParameterType="System.Int64" Output="true"/>
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs">
Incremented = Number + 1;
@Berzeg
Berzeg / .block
Last active March 27, 2025 06:20
Electrocardiogram
license: gpl-3.0
height: 300
@mystygage
mystygage / docker-compose.yml
Created March 6, 2017 21:02
Microsoft SQL Server in Docker with data volume
version: '3'
services:
mssql-server-linux:
image: microsoft/mssql-server-linux:latest
volumes:
- mssql-server-linux-data:/var/opt/mssql/data
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=${SQLSERVER_SA_PASSWORD:-yourStrong(!)Password}
@jehugaleahsa
jehugaleahsa / LTT.md
Last active June 17, 2024 17:35
LINQ Tricks and Techniques

Learn to Love LINQ

I've been using LINQ for years and I've come to deeply respect it as a technology. Unfortunately it has not been adopted by the .NET community as much as I would have expected. I honestly believe it is the single one feature that gives C# a competitive edge over many of the other general-purpose languages out there today. This document will go over some of the tricks I have learned to make the most of LINQ's powerful features. Hopefully you'll learn at least one trick along the way.

Query vs Method syntax

Yup, you can write your queries as a series of method calls or you can use the query syntax. Method syntax is fine when you're first starting out, but query syntax is more expressive in the long run. My experience has been that operations such as where, select, join, group by and order by should be expressed using query syntax and "reduce" operations should be done in method syntax. Unavoidably, you sometimes have to use method calls inside of your queries simply because th

@faruktoptas
faruktoptas / KeyboardSensitiveRelativeLayout.java
Last active November 3, 2023 17:50
A layout that detects Soft Keyboard is visible or not.
public class KeyboardSensitiveRelativeLayout extends RelativeLayout {
private OnKeyboardShowHideListener listener;
public KeyboardSensitiveRelativeLayout(Context context) {
super(context);
}
public KeyboardSensitiveRelativeLayout(Context context, AttributeSet attrs) {
super(context, attrs);
@JonCole
JonCole / StackExchangeRedisExtensions.cs
Last active March 13, 2019 19:16
StackExchange.Redis Extension Methods
namespace StackExchange.Redis
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
public static class StackExchangeRedisExtensions
{
public static IEnumerable<IServer> GetMasterServers(this IConnectionMultiplexer connection)
@mach6
mach6 / start.sh
Last active August 16, 2017 07:44
docker (v1.11.1) quickstart terminal start.sh for hyper-v host
#!/bin/bash
# ---------------------------------------------------------------------------------------------------------------------\
# Copyright (C) 2016 Doug Simmons |
# |
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance |
# with the License. |
# |
# You may obtain a copy of the License at |
# |
# http://www.apache.org/licenses/LICE
@tgjc
tgjc / not_in_lms.R
Created March 18, 2016 02:36
Script to read in HR data and filter using anti-joins
# Notes:
# 1. rename staff number field in each spreadsheet to "emp_id"
# 2. When adding new spreadsheets, convert emp_id class to character to allow anti_join() to work
# 3. if time allows, automate cleaning of column names and drop unused from hr-list.csv
library(dplyr)
library(readr)
@ekepes
ekepes / ConsoleApplication2.cs
Last active January 8, 2022 05:00
C# implementation of a Linear Congruential Generator (LCG) for psuedorandom number generation
using System;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
var freq = new int[20];
var rng = new RandomNumberGenerator();