Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jknopp's full-sized avatar
🏠
Working from home

Jon Knopp jknopp

🏠
Working from home
View GitHub Profile

Oops! I accidentally deleted a local git branch, and I haven't pushed it to a remote server yet. The branch has several important commits, and it hasn't been merged with any other branches yet. How do I find the missing branch?

1. Create a list of all dangling or unreachable commits.

$ git fsck --full --no-reflogs --unreachable --lost-found
unreachable tree 4a407b1b09e0d8a16be70aa1547332432a698e18
unreachable tree 5040d8cf08c78119e66b9a3f8c4b61a240229259
unreachable tree 60c0ce61b040f5e604850f747f525e88043dae12
unreachable tree f080522d06b9853a2f18eeeb898724da4af7aed9
@jknopp
jknopp / kentico-versions.sql
Created December 1, 2015 15:30
Check Kentico CMS Versions
select keyname, keyvalue
from CMS_SettingsKey
where keyname in ('CMSDataVersion','CMSDBVersion','CMSHotfixVersion')
@jknopp
jknopp / net-frameworks.ps1
Created September 13, 2016 16:01
Check which .NET Frameworks are Installed
gci 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | gp -name Version,Release -EA 0 | where { $_.PSChildName -match '^(?!S)\p{L}'} | select PSChildName, Version, Release
@jknopp
jknopp / RemoveCsProjDuplicates.ps1
Created August 16, 2019 18:16
Finds all csproj in the supplied path and removes all the duplicate entries
<#
.SYNOPSIS
Finds all csproj in the supplied path and removes all the duplicate entries.
.DESCRIPTION
This script finds all duplicate <content> and <compile> entries in csproj files,
and removes them.
.NOTES
File Name : RemoveCsProjDuplicates.ps1
Author : Rodrigo F. Fernandes - github.com/rodrigoff
.LINK
@jknopp
jknopp / ValueInjecterExtensions
Created September 6, 2019 19:04 — forked from Ablecken/ValueInjecterExtensions
ValueInjecter Create Type On Inject
using System;
using Omu.ValueInjecter;
namespace Infrastructure.Extensions
{
public static class ValueInjecterExtensions
{
/// <summary>
/// Will create a new instance of TResult, then inject from object
/// </summary>
@jknopp
jknopp / webpack.config.js
Created July 28, 2020 22:35 — forked from versedi/webpack.config.js
Webpack Encore + Sass + MiniCSSExtractPlugin + PurgeCSS + OptimizeCss + Babel + Typescript
/* eslint-disable no-useless-escape */
const Encore = require('@symfony/webpack-encore');
const TerserPlugin = require('terser-webpack-plugin');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const HtmlCriticalWebpackPlugin = require('html-critical-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const PurgeCssPlugin = require('purgecss-webpack-plugin');
const WebpackBar = require('webpackbar');
const path = require('path');
@jknopp
jknopp / sqlpackage.md
Created October 22, 2020 00:57 — forked from anova/sqlpackage.md
Sqlpackage.exe samples

Export

Creates a .bacpac file from live database.

"C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\SqlPackage.exe" /a:Export /scs:"Data Source=SERVER;Initial Catalog=db_name;Integrated Security=False;Persist Security Info=False;User ID=db_user;Password=db_password" /tf:"D:\backup\database_backup.bacpac"

Import

Import from .bacpac file to database.

@jknopp
jknopp / settings.json
Created December 4, 2020 05:35 — forked from chrisdias/settings.json
Chris Dias' settings.json for VS Code
{
/*
USER (GLOBAL) SETTINGS
~/Library/Application Support/Code-Insiders/User/settings.json
*/
/*
***************
*** WARM UP ***
***************
@jknopp
jknopp / index.js
Created December 12, 2020 04:07
Randomly Select Item from Array Based on Frequency
// Define our array of object we want to randomly select from
const fallingItems =
[{
id: 1,
value: 150,
image: 'rare.png',
velocity: 5000,
size: 60
},
{
# setup font settings
font_family FuraCode Nerd Font
font_size 18.0
# no bells. Ever.
enable_audio_bell no
bell_on_tab no
# default layout is vertical splits only
enabled_layouts splits