Skip to content

Instantly share code, notes, and snippets.

View vzool's full-sized avatar
🎯
Focusing

Abdelaziz Elrashed vzool

🎯
Focusing
  • Sudan
View GitHub Profile
@davidegironi
davidegironi / _bitbucket-git-downloader.sh
Created January 27, 2021 19:39
Script to download all repositories from a Bitbucket account
# Bitbucket Git Downloader
# Copyright (c) Davide Gironi, 2021
# Released under GPLv3
# Downloads all the repository from a Bitbucket account
@cutiko
cutiko / Readme.md
Created November 22, 2019 18:24
Git delete last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

ORIGINAL did fork but search didn't helped me

@vzool
vzool / gitlab-webhook-push.php
Created February 20, 2019 06:56 — forked from pitchart/gitlab-webhook-push.php
A simple php script to manage gitlab push webhook
<?php
/**
* GitLab Web Hook
* See https://gitlab.com/kpobococ/gitlab-webhook
*
* This script should be placed within the web root of your desired deploy
* location. The GitLab repository should then be configured to call it for the
* "Push events" trigger via the Web Hooks settings page.
*
* Each time this script is called, it executes a hook shell script and logs all
import base64
import random as r
MAX_VALUE = 256 * 9
private_key = int(r.random() * MAX_VALUE)
public_key = MAX_VALUE - private_key
shared_key = MAX_VALUE
print("Public Key: %d" % public_key)
@vzool
vzool / git.alias.sh
Last active February 12, 2022 09:34
Alias to push all branches to all remotes with just `git pushall`
#/bin/bash
git config --global alias.pushall '!git remote | xargs -L1 git push --all'
@vzool
vzool / main.go
Last active April 11, 2018 18:29
This is an example for Pyramid Hierarchy URL routes implemented using [Bone](https://github.com/go-zoo/bone)
package main
import (
"fmt"
"net/http"
"github.com/go-zoo/bone"
)
func main() {
@tokoiwesley
tokoiwesley / Install PHP 7.1 on Debian Stretch
Last active April 24, 2024 06:09
How To Install Php 7.1 On Debian
# Add Repository to your system (ondrej/php PPA)
sudo apt install apt-transport-https lsb-release ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt update
# Install PHP 7.1
sudo apt install php7.1
@chq-matteo
chq-matteo / signed-commits.md
Last active February 13, 2023 18:31
Signed commits with GPG

1. Generate a gpg key

With GnuPG 2.1.15

If you want to create an RSA or DSA key in a straight forward way use:

gpg --full-gen-key

If you want to use an ECC algorithm, you need to add the --expert flag

gpg --expert --full-gen-key

@vzool
vzool / Vue-global-event-dispatcher.js
Created November 30, 2017 09:20
Vue.js Global Event Dispatcher
window.Event = {
vue: new Vue(),
on: function(event, callback){
this.vue.$on(event, callback);
},
fire: function(event, data){
this.vue.$emit(event, data);
@dopey
dopey / main.go
Last active May 8, 2024 09:54 — forked from denisbrodbeck/main.go
How to generate secure random strings in golang with crypto/rand.
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"math/big"
)