Skip to content

Instantly share code, notes, and snippets.

@mfrancois3k
mfrancois3k / Litmus turing-example.yaml
Created December 22, 2022 21:27 — forked from thirteen37/turing-example.yaml
Litmus Example configuration for Turing
id: example_router
routes:
- id: tensorflow_model
type: PROXY
endpoint: "http://api.golabs.io/v2/5e4caccc310000e2cad8c071"
- id: control
type: PROXY
endpoint: "http://api.golabs.io/v2/5e4cacd4310000e1cad8c073"
strategy:
type: fiber.DefaultTuringRoutingStrategy
@mfrancois3k
mfrancois3k / html-email.txt
Created December 22, 2022 10:04 — forked from dmrqx/html-email.txt
HTML e-mail - coding resources
# Reading material, articles, guides
https://www.freecodecamp.org/news/the-fab-four-technique-to-create-responsive-emails-without-media-queries-baf11fdfa848/
https://www.smashingmagazine.com/2017/01/introduction-building-sending-html-email-for-web-developers/
https://webdesign.tutsplus.com/articles/everything-developers-need-to-know-about-sending-transactional-email--cms-31759
https://email.uplers.com/infographics/ultimate-guide-email-client-hacks/
https://www.leemunroe.com/sending-email-designers-developers/
https://www.leemunroe.com/building-html-email/
https://www.leemunroe.com/responsive-email-design/

Vagrant Cloud API Example

Create box

curl \
  --header "X-Atlas-Token: $VAGRANT_CLOUD_TOKEN" \
  --header "Content-Type: application/json" \
  https://app.vagrantup.com/api/v1/boxes \
  --data '{"username":"justin_hashicorp", "name":"test"}'
@mfrancois3k
mfrancois3k / Api vagrant_box_upload.sh
Created December 20, 2022 23:09 — forked from mattymo/vagrant_box_upload.sh
Api vagrant box upload
#!/bin/bash
# Requires jq in the path - apt install jq
# References
# https://www.vagrantup.com/docs/vagrant-cloud/api.html#creating-a-usable-box-from-scratch
# https://www.vagrantup.com/docs/vagrant-cloud/boxes/create.html
BOX_FILE=$1
USER=magmacore
@mfrancois3k
mfrancois3k / Api stripe money management endpoints.c
Created December 20, 2022 23:06 — forked from JaniKibichi/endpoints.c
Api stripe money management cURL Endpoints
Sandbox End Points
1. SMS
Make a HTTP POST request to https://api.sandbox.africastalking.com/version1/messaging
See the Parameters
curl -v -H "Accept: application/json" \
-d "username=sandBoxUserName&message=hello test&to=+254711XXXYYY,+254733YYYZZZ" \
-H "Apikey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" \
-X POST http://api.sandbox.africastalking.com/version1/messaging --insecure
@mfrancois3k
mfrancois3k / Api Google Congfig gmail.js
Last active December 20, 2022 23:03 — forked from vic/VicGmail.js
Api Google Congfig Gmail
// ==UserScript==
// @name Gmail w/ Collapsible & Minimalist Inbox plus Google Calendar, Reader, Notebook, etc... Seamless Integration
// @namespace mail.google.com
// @include http://mail.google.com/*
// @include https://mail.google.com/*
// ==/UserScript==
var USER_CONFIGURATION =
{
ELEMENTS: //Place in order the pages you would like to load. Placing mail in the list will may it collapsible. Other choices are: reader, calendar, notebook or groups (must be lowercase.)
@mfrancois3k
mfrancois3k / React Component SafeStringComponent.jsx
Last active December 15, 2022 11:48 — forked from bkonkle/SafeStringComponent.jsx
React Component SafeStringComponent
// reference
// https://victoria2666.medium.com/the-implications-of-dangerouslysetinnerhtml-in-react-64e2d02af66a
// npm install dompurify
import DOMPurify from "dompurify";
const React = require('react');
/**
@mfrancois3k
mfrancois3k / Gulp React gistfile1.js
Created December 15, 2022 11:35 — forked from bkonkle/gist:cb0abc09af20ce115583
Gulp React Simple JSX compile task
var args = require('../utils').args;
var debug = require('gulp-debug');
var gulp = require('gulp');
var gutil = require('gulp-util');
var notifier = require('node-notifier');
var path = require('path');
var plumber = require('gulp-plumber');
var react = require('gulp-react');
var production = (args.env === 'production');
@mfrancois3k
mfrancois3k / Electron Google Auth (Part 4).js
Last active December 15, 2022 11:34 — forked from bkonkle/Google Auth (Part 4).js
Electron Google Authentication (Part 4)
//put that code in main.js file
export async function fetchAccessTokens (code) {
const response = await axios.post(GOOGLE_TOKEN_URL, qs.stringify({
code,
client_id: GOOGLE_CLIENT_ID,
redirect_uri: GOOGLE_REDIRECT_URI,
grant_type: 'authorization_code',
}), {
headers: {
@mfrancois3k
mfrancois3k / Electron Google Auth (Part 3).js
Created December 15, 2022 11:33 — forked from bkonkle/Google Auth (Part 3).js
Electron Google Authentication - Part 3
//put that code in main.js file
function handleNavigation (url) {
const query = parse(url, true).query
if (query) {
if (query.error) {
reject(new Error(`There was an error: ${query.error}`))
} else if (query.code) {
// Login is complete
authWindow.removeAllListeners('closed')
setImmediate(() => authWindow.close())