Skip to content

Instantly share code, notes, and snippets.

View MelnikovIG's full-sized avatar
💭
🚀

Igor Melnikov MelnikovIG

💭
🚀
View GitHub Profile
@MelnikovIG
MelnikovIG / recover-deleted-branch.sh
Created May 18, 2018 12:22 — forked from umayr/recover-deleted-branch.sh
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@MelnikovIG
MelnikovIG / Barbeque.cs
Created May 4, 2018 10:44 — forked from ForNeVeR/Barbeque.cs
Bool not equal to true neither to false.
using System;
using System.Runtime.InteropServices;
namespace ConsoleApplication2
{
[StructLayout(LayoutKind.Explicit)]
internal struct Barbeque
{
[FieldOffset(0)] public int Barbe;
[FieldOffset(0)] public bool Que;
@MelnikovIG
MelnikovIG / CreateStaticClass.cs
Created January 12, 2018 13:39 — forked from ForNeVeR/CreateStaticClass.cs
Static class creation test.
using System;
using System.Reflection;
class Program
{
static void Main(string[] args)
{
var allocate = typeof(RuntimeTypeHandle).GetMethod("Allocate", BindingFlags.NonPublic | BindingFlags.Static);
var math = allocate.Invoke(null, new[] { typeof (Math) });
@MelnikovIG
MelnikovIG / gist:b8bfb6e056ebcfcceebd7b7e4a201708
Created December 6, 2017 13:00 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@MelnikovIG
MelnikovIG / CSharpInProcessCompiler
Created April 3, 2016 12:03 — forked from nesteruk/CSharpInProcessCompiler
C# in-process compiler
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Text;
using Microsoft.CSharp;
namespace ActiveMesa.R2P.Infrastructure
{