Skip to content

Instantly share code, notes, and snippets.

View kad1r's full-sized avatar

Kadir Avcı kad1r

View GitHub Profile
@ardacetinkaya
ardacetinkaya / StoredProcedure_Table_Relation.sql
Last active April 28, 2019 22:52
Simple SQL to find tables that are used in a stored procedure. #mssql #sql #sqlserver #storedprocedure
DECLARE @temptableforSP TABLE (spName varchar(100), tableName nvarchar(100))
DECLARE @SP_Name as NVARCHAR(100);
DECLARE @SP_Cursor as CURSOR;
SET @SP_Cursor = CURSOR FOR
SELECT [name] FROM sys.objects WHERE name LIKE 'sp%' AND type='P' -- Gets SPs for specific names
OPEN @SP_Cursor;
FETCH NEXT FROM @SP_Cursor INTO @SP_Name;
WHILE @@FETCH_STATUS = 0
@lucasvcardoso
lucasvcardoso / How to recover unsaved tabs that were closed in Notepad++.md
Last active December 6, 2021 15:47
How to recover unsaved tabs that were closed in Notepad++

Recover unsaved tabs in Notepad++

ATENTION:

Notepad++ saves these temporary files for only a certain amount of time, so there's no guarantee that you will be able to recover your lost tab, specially if it was closed too long before. But it's still worth a shot to avoid losing work.

On Windows:

  • Go to console %APPDATA%\Notepad++\backups

Notes:

@madskristensen
madskristensen / ETagMiddleware.cs
Last active September 11, 2024 18:38
ASP.NET Core ETAg middleware
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Net.Http.Headers;
using System.IO;
using System.Security.Cryptography;
using System.Threading.Tasks;
public class ETagMiddleware
{
When building an adnroid app, you might stumble upon this error:
`Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE...`. Here's how to fix it:
That's because the app you're trying to test was already installed on the device and the signatures are different now, so it's complaining. The full error will look like something like this:
`Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.example signatures do not match the previously installed version; ignoring!`
You can see that the package ID is `com.example`, well, simply run this command:
@zerda
zerda / .gitlab-ci.yml
Last active August 8, 2023 07:52
Gitlab CI for ASP.Net Core project
stages:
- build
- publish
.build: &build_template
stage: build
image: microsoft/dotnet:2.1-sdk-alpine
cache:
key: "$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME"
paths:
@danhper
danhper / gitlab-to-bitbucket.py
Last active September 24, 2024 09:41
Script to migrate repositories from GitLab to Bitbucket
import os
import re
import subprocess
import requests
GITLAB_ENDPOINT = os.environ["GITLAB_ENDPOINT"]
GITLAB_TOKEN = os.environ["GITLAB_TOKEN"]
@emir
emir / challenge.md
Last active November 7, 2016 12:07
Medium Challenge (Kasım)
@wojteklu
wojteklu / clean_code.md
Last active July 4, 2025 12:37
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@vielhuber
vielhuber / script.sh
Last active June 24, 2025 10:24
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@tonysneed
tonysneed / Mac OS X: Open in Visual Studio Code
Last active March 29, 2025 18:40
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"