Skip to content

Instantly share code, notes, and snippets.

View jbelmont's full-sized avatar
💭
Weekend Mode

Jean-Marcel Belmont jbelmont

💭
Weekend Mode
View GitHub Profile
@chancez
chancez / example.tf
Last active November 20, 2023 21:56
Support creating a DNS validated ACM certificate containing SANs for multiple different hosted zones
module "combined_acm_certificate" {
source = "../../modules/acm_certificate_dns_validated_multi_zone"
domain_name = "infra.example.com"
zone_to_san = {
"infra.example.com" = [
"*.infra.example.com",
"*.dev.infra.example.com",
"*.staging.infra.example.com",
"*.production.infra.example.com",
@habuma
habuma / YesNoIntents.adoc
Created March 6, 2020 04:08
Handling Yes/No Intents in an Alexa Skill

An Alexa skill may ask a user a Yes/No question and the response handled by request handlers for the built-in AMAZON.YesIntent and AMAZON.NoIntent intents. (This is different than dialog confirmation where Yes/No confirmation is handled by the dialog.)

It’s easy to setup these intents and their respective intent handlers. Just like any intent, declare them in the interaction model:

{
  "name": "AMAZON.YesIntent",
  "samples": []
},
{
// a list of useful queries for profiler analysis. Starting with the most basic.
// 2.4 compatible
//
// output explained:
//
{
"ts" : ISODate("2012-09-14T16:34:00.010Z"), // date it occurred
"op" : "query", // the operation type
"ns" : "game.players", // the db and collection
@jbelmont
jbelmont / mongo_shell_tips.md
Last active March 4, 2019 00:24
A list of commands you can use in mongodb.

Basic Commands

Action Run Command Example
Connect to local host on default port 27017 mongo mongo
Connect to remote host on specified port mongo --host --port mongo --host 192.168.65.23 --port 27020
Connect to a database mongo / mongo 192.168.65.23/api
Show current database db db
Select or switch database use use api
Execute a JavaScript file load() load (program.js)
## GIT PROMPT DISPLAY
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✚"
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[red]%} ⇡"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[014]%} ✭"
PROMPT='$FG[008][%*]%{$reset_color%} $FG[004]%~%{$reset_color%} $FG[006]$(git_current_branch)%{$reset_color%}$(git_prompt_status)
$FG[002]❯%{$reset_color%} '
@kevinadi
kevinadi / mgo-ssl.go
Last active January 5, 2024 16:02
Small example of using MongoDB go driver (mgo) to connect using SSL with client certificate
package main
import (
"fmt"
"log"
"net"
"crypto/tls"
"crypto/x509"
@kevinadi
kevinadi / mongodb-ssl.sh
Last active September 20, 2024 10:10
Script to create self-signed CA certificates, server certificates, and client certificates for testing MongoDB with SSL
#!/bin/sh
# Generate self signed root CA cert
openssl req -nodes -x509 -newkey rsa:2048 -keyout ca.key -out ca.crt -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=root/CN=`hostname -f`/[email protected]"
# Generate server cert to be signed
openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=server/CN=`hostname -f`/[email protected]"
# Sign the server cert
## GIT PROMPT DISPLAY
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✚"
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[red]%} ⇡"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[014]%} ✭"
PROMPT='$FG[008][%*]%{$reset_color%} $FG[004]%~%{$reset_color%} $FG[006]$(git_current_branch)%{$reset_color%}$(git_prompt_status)
$FG[002]❯%{$reset_color%} '
@ilyaigpetrov
ilyaigpetrov / Meteor Alternatives Per Feature.md
Last active September 15, 2024 20:21
Meteor Alternatives Per Feature | by https://git.io/ilyaigpetrov

Meteor Alternatives Per Feature

This table was created in 2015 so may be quite outdated today.

Feature Meteor Solution Alternative Solutions Description
Live DB Sync [livequery][lq] ([mongo-oplog]), [ddp] RethinkDB, Redis, ShareDB, [npm:mongo-oplog], [firebase], etc. Push DB updates to client/server.
Latency Compensation, Optimistic UI [minimongo][mm] [RethinkDB][lcr], [mWater/minimongo] (fork, not ws but http, browserify) Imitate successful db query on client before it is done.
Isomorphic Code [isobuild] & isopacks browserify Write one code for server/client/mobile.
Isomorphic Packaging [isobuild], atmosphere No more separate packages for server & client. Get bower + npm + mobile.
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active October 1, 2024 17:10
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest