Skip to content

Instantly share code, notes, and snippets.

@dasniko
dasniko / create_x509_certs.md
Last active August 29, 2024 13:38
Creating self signed tls certificates with self-signed root CA
@drewchapin
drewchapin / Template.nsi
Created February 20, 2018 19:09
Template for modern NSIS installation script
;-------------------------------------------------------------------------------
; Includes
!include "MUI2.nsh"
!include "LogicLib.nsh"
!include "WinVer.nsh"
!include "x64.nsh"
;-------------------------------------------------------------------------------
; Constants
!define PRODUCT_NAME "My Application"
@LitKnd
LitKnd / !configure-blocked-process-report.sql
Last active April 24, 2023 19:57
Blocked Process Report - Configuring and Tracing - SQL Server
/***********************************************************************
Copyright 2016, Kendra Little - littlekendra.com
MIT License, http://www.opensource.org/licenses/mit-license.php
***********************************************************************/
/***********************************************************************
FIRST, TELL SQL SERVER TO ISSUE THE BLOCKED PROCESS REPORT
***********************************************************************/
/* Check if there are any pending configuration items before you start */
@brakmic
brakmic / json_stringify_circular_for_angular.js
Last active July 31, 2017 12:22
AngularJS-Module: Stringify JSON Objects with circular dependencies
(function () {
/* converted by @brakmic */
/* original code: https://github.com/isaacs/json-stringify-safe */
/* usage example:
*
*angular.module("myModule", ['jsonStringify'])
* .controller("MainCtrl", ['StringifyJsonService', MainCtrl]);
*
@todgru
todgru / git_revert.md
Created December 20, 2012 01:20
how to use git revert --strategy resolve

Oh yes, this is nice:

git revert --strategy resolve <sha-ish>

Given a git log of A--B--C--D--E you can remove commit C using:

git revert --strategy resolve <sha-of-C> 

Which will produce:

@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active November 17, 2024 13:10
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'