Skip to content

Instantly share code, notes, and snippets.

View llCorvinSll's full-sized avatar

Dmitry Pronin llCorvinSll

View GitHub Profile
@llCorvinSll
llCorvinSll / gist:d0d536a6453bdeb3e8c1fa0f741c0573
Created August 3, 2016 07:01 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote

Keybase proof

I hereby claim:

  • I am llCorvinSll on github.
  • I am corvinus (https://keybase.io/corvinus) on keybase.
  • I have a public key whose fingerprint is 5FC2 D0BE 153C A554 B993 F53F E8E2 8A2F 73A0 09A2

To claim this, I am signing this object:

@llCorvinSll
llCorvinSll / convert hash to N-digit string.cs
Created January 24, 2014 11:36
TOTP: Time-Based One-Time Password Algorithm http://tools.ietf.org/html/rfc6238#
public static string GeneratePassword(string secret, long iterationNumber, int digits = 6)
{
byte[] counter = BitConverter.GetBytes(iterationNumber);
if (BitConverter.IsLittleEndian)
Array.Reverse(counter);
byte[] key = Encoding.ASCII.GetBytes(secret);
HMACSHA1 hmac = new HMACSHA1(key, true);
@llCorvinSll
llCorvinSll / build.txt
Created November 3, 2013 09:57
Qt subdirs project and setup deps between subprojects
include( ../common.pri )
TEMPLATE = app
SOURCES += main.cpp
LIBS += -L../logic -llogic \
-L../gui -lgui
# Will build the final executable in the main project directory.