Skip to content

Instantly share code, notes, and snippets.

View lovato's full-sized avatar

Marco Lovato lovato

  • Vancouver WA, USA
View GitHub Profile
@n8henrie
n8henrie / alexa-skills-kit-color-expert-python.py
Created March 23, 2016 03:20
Amazon's example Alexa Skills lambda function
"""
This sample demonstrates a simple skill built with the Amazon Alexa Skills Kit.
The Intent Schema, Custom Slots, and Sample Utterances for this skill, as well
as testing instructions are located at http://amzn.to/1LzFrj6
For additional samples, visit the Alexa Skills Kit Getting Started guide at
http://amzn.to/1LGWsLG
"""
from __future__ import print_function
@glenrobertson
glenrobertson / flask_cache_response_decorator.py
Last active January 15, 2022 21:15
Flask response cache decorator
import datetime
import time
from functools import wraps
from wsgiref.handlers import format_date_time
from flask import make_response
def cache(expires=None, round_to_minute=False):
"""
Add Flask cache response headers based on expires in seconds.
@timusg
timusg / keepalived-eip-switch.erb.sh
Last active October 20, 2016 21:01
keepalived notification script for switch elastic ip, helpful to setup highly available haproxy in ec2/VPC
#!/bin/bash
export EC2_HOME=/usr/local/share/ec2_tools/
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:$EC2_HOME/bin
INSTANCEID=`curl -s http://169.254.169.254/latest/meta-data/instance-id`
case "$1" in
MASTER)
logger triggering notify master event
@emil2k
emil2k / Connectivity.java
Last active December 22, 2023 06:03
Android utility class for checking device's network connectivity and speed.
/*
* Copyright (c) 2017 Emil Davtyan
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@rodw
rodw / backup-github.sh
Last active March 30, 2024 15:04
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
#-------------------------------------------------------------------------------
# NOTES:
#-------------------------------------------------------------------------------
# * Under the heading "CONFIG" below you'll find a number of configuration
# parameters that must be personalized for your GitHub account and org.
# Replace the `<CHANGE-ME>` strings with the value described in the comments
# (or overwrite those values at run-time by providing environment variables).
@mprihoda
mprihoda / xls2pdf.py
Created June 7, 2012 20:45
Convert XLS to PDF using Iron Python and MS Office
import clr
import sys
import os.path
clr.AddReference("Microsoft.Office.Interop.Excel")
from Microsoft.Office.Interop import Excel
from System import Type, GC
# See http://msdn.microsoft.com/en-us/library/bb407651.aspx for