Skip to content

Instantly share code, notes, and snippets.

@Ho6hTTOYGg2e
Ho6hTTOYGg2e / go-promise-caching.go
Last active September 1, 2019 10:24
move to repository
// moved to https://github.com/vahid-ashrafian/go-promise-caching
@meysampg
meysampg / protobuf_import.md
Last active January 23, 2019 11:40
protobuf_import.md

Dummy Introduction to Protobuf Compile

Import protobuf models into other and compile them

tsjd [To short, just do];

  1. Define go_package option something like:
option go_package = "github.com/meysampg/project_name/pb/folder_name_which_compiled_model_must_be_on_it";
<?php
class Match
{
protected $value;
protected $result;
protected $hasMatch;
public function __construct($value)
{
@kbariotis
kbariotis / main.yaml
Last active August 5, 2024 08:31
Ansible playbook for deploying a Node.js app to DigitalOcean
- name: DO
hosts: localhost
vars:
project_name: "PUT A NAME FOR YOUR PROJECT HERE"
do_token: "PUT YOUR DIGITAL OCEAN API KEY HERE ==> https://cloud.digitalocean.com/settings/api/tokens"
repository: "PUT YOUR REPOSITORY URL HERE"
tasks:
- name: LOCAL | Generate SSH key
shell: ssh-keygen -b 2048 -t rsa -f ~/.ssh/{{project_name}} -q -N ""
@zhiguangwang
zhiguangwang / README.md
Last active October 26, 2024 14:58
Installing and running shadowsocks on Ubuntu Server

Installing and running shadowsocks on Ubuntu Server

16.10 yakkety and above

  1. Install the the shadowsocks-libev package from apt repository.

     sudo apt update
     sudo apt install shadowsocks-libev
    
  2. Save ss.json as /etc/shadowsocks-libev/config.json.

@reshadman
reshadman / action.js
Last active November 1, 2015 11:57
Processing Laravel jobs from node.
'use strict';
var redis = require('redis');
var LaravelJob = require('./index');
// Create laravel job instance
var job = new LaravelJob({});
// Set handlers on the job
job.registerHandler("Jobinja\\Jobs\\ExampleJob", function(job, payload) {
console.log(payload);
@phemmer
phemmer / main.go
Created September 23, 2015 04:41
xml rsa private key to pem converter in golang
/*
Usage: go run main.go < /path/to/private-key.xml
Optionally takes base64 encoded input.
This is a very crude implementation. Any errors result in a panic.
*/
package main
import (
@hallaji
hallaji / README.markdown
Last active August 9, 2017 02:49
Iranian National Identifier Validator

Iranian National Identifier Validator

A validator for Iranian (Persian) national identifier or social number

Languages

c#, java, javascript, php

Types

parameter: string (It doesn't support arabic or persian numbers)
return: boolean

@jaceklaskowski
jaceklaskowski / Rough Notes about CQRS and ES.md
Last active August 20, 2024 10:55
Rough Notes about CQRS and ES

Rough Notes about CQRS and ES

Once upon a time…

I once took notes (almost sentence by sentence with not much editing) about the architectural design concepts - Command and Query Responsibility Segregation (CQRS) and Event Sourcing (ES) - from a presentation of Greg Young and published it as a gist (with the times when a given sentence was heard).

I then found other summaries of the talk and the gist has since been growing up. See the revisions to know the changes and where they came from (aka the sources).

It seems inevitable to throw Domain Driven Design (DDD) in to the mix.

@rasheedamir
rasheedamir / DDD, CQRS & ES.md
Last active January 25, 2022 12:09
DDD, CQRS & ES!

To implement command processing we need the following pieces:

  • Commands which request that something should happen, i.e. some state change
  • Events which indicate that something has happened
  • Aggregates that handles Commands and generates Events based on the current state
  • Event store which stores all events that has happened
  • Application services that receives Commands and routes it to the appropriate aggregate

https://github.com/rasheedamir/event-sourcing-in-practice