This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Place this file in your lambda package next to the handler file. | |
Setting the log formatter on lambda loses the request id out of the context. | |
But, you often want to use a logger across a few files and name them | |
or change the log format. | |
This factory will ensure that the lambda context id is available to any | |
log format you choose. It also has the ability to filter out strings | |
from the logs using a regular expression. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Unit test setup automatically called | |
''' | |
from unittest import mock | |
import pytest | |
# Fixture, autouse | |
@pytest.fixture(scope='session', autouse=True) | |
def patch_boto3(request): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /path/to/your/github/repo | |
echo "GITHUB_TOKEN=$GITHUB_TOKEN" > mutato.env | |
aws-vault exec <profile name> -- env | grep AWS_ >> mutato.env | |
docker run -it --rm --env-file mutato.env -v `pwd`:/project stelligent/mutato bootstrap | |
docker run -it --rm --env-file mutato.env -v `pwd`:/project stelligent/mutato deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:16.04 | |
LABEL Description="Image for buiding arm project with mcuxpresso" | |
WORKDIR /work | |
ENV SDK_VERSION 2.5.0 | |
ENV IDE_VERSION 10.3.0_2200 | |
COPY ./mcuxpressoide-${IDE_VERSION}.x86_64.deb.bin /work | |
COPY ./SDK_${SDK_VERSION}_LPC54018-IoT-Module.zip /work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# UPSTART SCRIPT | |
# /etc/init/{taskname}.conf | |
# This task is run on startup to run miniweb which is a tiny static server | |
description "Run the miniweb web form" | |
start on (filesystem and net-device-up IFACE!=lo) | |
task | |
exec sudo twistd -no web --path /path/to/web/dir --port="tcp:8000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import BaseHTTPServer, SimpleHTTPServer | |
import ssl, os, sys | |
port = int(sys.argv[1]) if len(sys.argv) > 1 else 4443 | |
cwd = os.path.dirname(os.path.realpath(__file__)) | |
pem = os.path.join( cwd, 'mycert.pem' ) | |
os.chdir(cwd) | |
class MyHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def end_headers(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# UPSTART SCRIPT | |
# /etc/init/{taskname}.conf | |
# This task is run on startup to run miniweb which is a tiny static server | |
description "Run the miniweb web form" | |
start on (filesystem and net-device-up IFACE!=lo) | |
task | |
exec /usr/bin/miniweb -p 8000 -r /home/helios/Documents/ticket-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
taskkill /F /IM Chrome.exe /T | |
### Open a local index.html file in the same directory as this batch file | |
# start chrome --kiosk --profile-directory=Default --app="%~dp0/index.html" | |
### Open a website URL | |
start chrome --kiosk --profile-directory=Default --app="http://google.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@user = { | |
:user => { | |
:id => 'johndoe', # required | |
:displayname => 'John Doe', # required | |
:email => '[email protected]', | |
:avatar => '//gravatar.com/avatar/e5fb96fe7ec4ac3d4fa675422f8d1fb9', | |
:is_admin => true | |
} | |
} | |
require 'digest/sha1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
MutationObserver = window.MutationObserver || window.WebKitMutationObserver; | |
function time(target){ | |
target.innerHTML = target.time; | |
} | |
moot("format", function(body, post) { | |
var $ = jQuery; | |
var $post = $(body).parents('.m-post')[0]; |
NewerOlder