Skip to content

Instantly share code, notes, and snippets.

View vzool's full-sized avatar
🎯
Focusing

Abdelaziz Elrashed vzool

🎯
Focusing
View GitHub Profile
@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() {
@vzool
vzool / gist:a3133b57c09ef4fcbea005d0c991e723
Created April 2, 2018 07:07 — forked from kapkaev/gist:4619127
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. Resque
$ redis-cli
> config set stop-writes-on-bgsave-error no
@vzool
vzool / PickDominantColor.java
Created March 22, 2018 11:34 — forked from KKorvin/PickDominantColor.java
How to pick dominant color from image on Android. Palette Google library used.
// Don't forget to add Palette library to your build.gradle
// compile 'com.android.support:palette-v7:+'
public static int getDominantColor(Bitmap bitmap) {
List<Palette.Swatch> swatchesTemp = Palette.from(bitmap).generate().getSwatches();
List<Palette.Swatch> swatches = new ArrayList<Palette.Swatch>(swatchesTemp);
Collections.sort(swatches, new Comparator<Palette.Swatch>() {
@Override
public int compare(Palette.Swatch swatch1, Palette.Swatch swatch2) {
return swatch2.getPopulation() - swatch1.getPopulation();
@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);
@vzool
vzool / hash_hmac_receiver.php
Created November 28, 2017 09:42 — forked from samarpanda/hash_hmac_receiver.php
Adding content verification using hmac in php
<?php
function get_private_key_for_public_key($public_key) {
// extract private key from database or cache store
return 'private_key_user_id_9999';
}
// Data submitted
$data = $_GET['data'];
$data = json_decode(stripslashes($data), TRUE);
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.6
Comment: Hostname: gpg.NebrWesleyan.edu
mQENBFoXLK4BCAD1yPex8TgzEd9zKLHZdwMrxjttLw95+tchuqfvaX8o2OutTFH8y99FAbVn
rXacPGNcUaL9lqbqdJgcez6ie0yWjLSlqcsPXkz07lvB3Ebmh38mFnKv/knGnw3W9uUNmmIj
rfoVGt72kXOfRWUZR8XviuB/c4XEAPazWY+4ILokIrLL6UooPvIeWl5jbPA0EaYztSe9uV/+
T7gc8T/N6ruP97fGyUgltb1/BfJFWX76pmHAQb6hxV0dBJGF+5W1HX/f4IRc4Cn9iOw1J2GN
71bLX41R7Q+EGhGQ9Z94+GlnUMPyCODhq5uHfrNnEx3wkTpu4eXpt++ho9GqgcMQDR4/ABEB
AAG0Jk1yLiBBYmRlbGF6aXogRWxyYXNoZWQgPGFlZW1oQGFvbC5jb20+iQEcBBABCgAGBQJa
@vzool
vzool / openpgp.txt
Created November 24, 2017 06:49
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:795188067a8ac283c8a0c32ebe6ceed9e8b93a49]
@vzool
vzool / openpgp.txt
Created November 24, 2017 06:49
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:795188067a8ac283c8a0c32ebe6ceed9e8b93a49]
@vzool
vzool / openpgp.txt
Created November 24, 2017 06:48
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:795188067a8ac283c8a0c32ebe6ceed9e8b93a49]
@vzool
vzool / openpgp.txt
Created November 24, 2017 06:48
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:795188067a8ac283c8a0c32ebe6ceed9e8b93a49]