Skip to content

Instantly share code, notes, and snippets.

View gon1332's full-sized avatar
🛀
bitbathing

Ioannis Konstantelias gon1332

🛀
bitbathing
  • Camlin Group
  • Belfast, UK
View GitHub Profile
@fworks
fworks / install-zsh-windows-git-bash.md
Last active September 19, 2024 14:16
Zsh / Oh-my-zsh on Windows Git Bash
@korzo89
korzo89 / hex.cmake
Created March 5, 2017 13:11
CMake dec<->hex conversion functions
function(from_hex HEX DEC)
string(SUBSTRING "${HEX}" 2 -1 HEX)
string(TOUPPER "${HEX}" HEX)
set(_res 0)
string(LENGTH "${HEX}" _strlen)
while(_strlen GREATER 0)
math(EXPR _res "${_res} * 16")
string(SUBSTRING "${HEX}" 0 1 NIBBLE)
string(SUBSTRING "${HEX}" 1 -1 HEX)
@iwalpola
iwalpola / stm32_gpio_reg.md
Last active August 30, 2024 18:03
STM32 GPIO registers cheatsheet
@robertpainsi
robertpainsi / README.md
Last active September 18, 2024 19:52
How to reopen a pull-request after a force-push?

How to reopen a pull-request after a force-push?

Precodinitions

  • You need the rights to reopen pull requests on the repository.
  • The pull request hasn't been merged, just closed.

Instructions

  1. Write down the current commit hash of your PR-branch git log --oneline -1 <PR-BRANCH>
  2. Write down the latest commit hash on github before the PR has been closed.
  3. git push -f origin :
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
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
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active September 21, 2024 23:07
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@aras-p
aras-p / preprocessor_fun.h
Last active September 8, 2024 07:43
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@mhulse
mhulse / admin.py
Created September 19, 2011 19:25
Django google maps v3 snipplet [via] admin example (tested in Django 1.4.x) (second example)
from <app_name>.models import Foo
# ...
# Using the default admin interface:
admin.site.register(Foo)
@mhulse
mhulse / admin.py
Created September 6, 2011 04:33
Django google maps v3 snipplet [via] admin example (tested in Django 1.4.x)
from django.contrib import admin
from myapp.models import Foo
from myapp.forms import FooForm
class FooAdmin(admin.ModelAdmin):
form = FooForm
prepopulated_fields = { 'slug': ['title'] }