Skip to content

Instantly share code, notes, and snippets.

View bweston92's full-sized avatar
📝
go hardwork.Do(ctx, energySupplier, privRepo)

Bradley Weston bweston92

📝
go hardwork.Do(ctx, energySupplier, privRepo)
View GitHub Profile
@yunano
yunano / vault.service
Last active August 17, 2023 08:51
/etc/systemd/system/vault.service
[Unit]
Description=vault server
Requires=network-online.target
After=network-online.target consul.service
[Service]
EnvironmentFile=-/etc/sysconfig/vault
Restart=on-failure
ExecStart=/usr/local/sbin/vault server $OPTIONS -config=/etc/vault.d
ExecStartPost=/bin/bash -c "for key in $KEYS; do /usr/local/sbin/vault unseal $CERT $key; done"
@codeliner
codeliner / bc_interaction_sample.php
Created April 15, 2014 13:06
Sample to show interaction between two bounded contexts
<?php
/**
* This file is an example gist to show the interaction between an ArticleContext and a LikeContext
*
* @example:
*
* We have to bounded contexts: ArticleContext and LikeContext and show the simplified process of following use case:
*
* In order to create a valid article Like, I should validate the article ID given to the LikeContext.
*
@io41
io41 / paginated_collection.js
Created February 22, 2011 10:10 — forked from zerowidth/paginated_collection.js
Pagination with Backbone.js
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
@JosephPecoraro
JosephPecoraro / shell-execution.rb
Last active September 10, 2023 10:12
Shell Execution in Ruby
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Synchronous (blocking)
# Returns the output of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111