Skip to content

Instantly share code, notes, and snippets.

View dhonx's full-sized avatar
🚩
Working on Private Projects

Don Alfons Nisnoni dhonx

🚩
Working on Private Projects
View GitHub Profile
@dhonx
dhonx / c_cpp_properties.json
Last active September 17, 2019 23:04
VSCode C++ Config File for Node-GTK Project
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/glib-2.0",
"${HOME}/.node-gyp/12.9.1/include/node",
"/usr/lib/x86_64-linux-gnu/glib-2.0/include",
"/usr/include/gobject-introspection-1.0"
@dhonx
dhonx / hello-world.cc
Created August 18, 2019 08:02 — forked from tejom/hello-world.cc
console.log v8
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fstream>
#include <iostream>
@dhonx
dhonx / css-hacks.css
Last active September 6, 2019 09:58
CSS Hacks
/* Read for more in here -> https://dev.to/gajus/my-favorite-css-hack-32g3 */
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
* * * * * * * { background-color: rgba(255,0,0,.2); }
* * * * * * * * { background-color: rgba(0,255,0,.2); }
* * * * * * * * * { background-color: rgba(0,0,255,.2); }
@dhonx
dhonx / gist:067df9f44bf0b727fac035b7c11a3936
Last active November 8, 2019 07:09 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com: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
@dhonx
dhonx / revert_commit.sh
Created September 29, 2019 01:37
Revert Git Commit
# Checkout the desired branch
git checkout <branch>
# Undo the desired commit
git revert <commit>
# Update the remote with the undo of the code
git push origin <branch>
@dhonx
dhonx / update_branch_list_from_remote.sh
Created November 8, 2019 07:08
Git: Update Branch List from Remote
# Source: https://stackoverflow.com/questions/36358265/when-does-git-refresh-the-list-of-remote-branches
# To update the local list of remote branches:
git remote update origin --prune
@dhonx
dhonx / store_v_function_on_array.v
Created November 17, 2019 18:17
Store function on array - V Programming Language
struct Sintf {
func fn() int
}
// Helper for calling the function
fn callf(p voidptr) int {
f := Sintf{ p }.func
return f()
}
@dhonx
dhonx / Files changed since last tag
Created December 22, 2019 07:10 — forked from arnold-almeida/Files changed since last tag
GIT: Files changed since last tag
#!/bin/bash
unset GIT_DIR
cd /path/to/project
# Get our info....
LATEST_TAG=$(git describe --tags --abbrev=0)
CURRENT_REVISION=$(git describe)
NUMBER_FILES_CHANGED=$(git diff --name-only HEAD $LATEST_TAG | wc -l)
#FILES_CHANGED=$(git diff --name-only HEAD $LATEST_TAG)
@dhonx
dhonx / git-clearHistory
Created December 29, 2019 16:51 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@dhonx
dhonx / gist:068314e97b644be9bbc5b2411df32753
Created January 8, 2020 01:55 — forked from kitek/gist:1579117
NodeJS create md5 hash from string
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");