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
@jknopp
jknopp / hierarchicalConverter
Created April 27, 2024 00:27 — forked from thesid/hierarchicalConverter
Convert Flat string list to hierarchical object using C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
public static class Program
{
@jknopp
jknopp / .gitconfig
Created August 10, 2023 17:00 — forked from natescode/.gitconfig
Git Aliases to make GIT easier to work with
[user]
email = your_email
name = your_username
[alias]
# view your global git config Aliases from CLI
aliases = config --get-regexp '^alias\\.'
# git clone
cl = !git clone
# Git shallow clone for large repos
clq= !git clone --depth=1
@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 / 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 / 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 / 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>

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