Skip to content

Instantly share code, notes, and snippets.

View beardedeagle's full-sized avatar
😒
Making the world functional.

Randy Thompson beardedeagle

😒
Making the world functional.
View GitHub Profile
@brenopolanski
brenopolanski / docker-cp-container-host.md
Created November 2, 2017 17:37
Docker - copy file from container to host

In order to copy a file from a container to the host, you can use the command:

docker cp <containerId>:/file/path/within/container /host/path/target
defmodule Swarm.DynamicSupervisor do
use GenServer
require Logger
defstruct [
:child_name,
:child_module,
:child_args,
:group,
:pid,
@slackpad
slackpad / bootstrap.md
Last active September 27, 2020 17:57
Bootstrapping Consul Servers with Version 8 ACLs Enabled (v0.8.1)
@citrusui
citrusui / dropdown.md
Last active October 4, 2024 09:42
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
@gbin
gbin / PluginMaker.py
Last active July 24, 2019 21:16
This is an example plugin for errbot generating plugins and commands dynamically
from errbot import BotPlugin, botcmd
class PluginMaker(BotPlugin):
""" Example demonstrating how to create an errbot plugin out of thin air.
This basically generates a plugin from scratch and registers it at activation.
"""
def activate(self):
super().activate()
@beardedeagle
beardedeagle / fieldSelectMixin
Created April 27, 2015 05:01
Field selection mixins for Tastypie (dehydrate, full_dehydrate and db level filter)
###################################################################
# mixin that utilizes dehydrate to implement field selection #
# Tested with python 2.7.5, django 1.8 and django-tastypie 0.12.1 #
###################################################################
class fieldSelectMixin(object):
"""
Mixin to allow field selection, dehydrate method.
"""
def dehydrate(self, bundle):
selectedFields = bundle.request.GET.get('fields')
@biomorgoth
biomorgoth / resource_mixin.py
Last active August 29, 2015 14:20
Tastypie Resource Mixin for selecting only a specific set of object fields from DB from a URL query
class FieldSelectMixin(object):
"""
Mixin to allow field selection.
This has to be done in two parts:
1) In model queryset for database selection. This need to be in some code section
where the queryset is ready, but still not evaluated. obj_get_list and obj_get are perfect
for Tastypie GET requests.
2) In full_dehydrate method, to prevent from Tastypie fetching all the fields from the model.
"""
def full_dehydrate(self, bundle, for_list=False):
@denji
denji / golang-tls.md
Last active November 7, 2024 05:58 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@zsup
zsup / ddd.md
Last active November 9, 2024 06:01
Documentation-Driven Development (DDD)

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.
@rxaviers
rxaviers / gist:7360908
Last active November 16, 2024 07:02
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: