Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Happily Coding!

Gary A. Stafford garystafford

💭
Happily Coding!
View GitHub Profile
View lexicon2.pls
<?xml version="1.0" encoding="UTF-8"?>
<lexicon version="1.0"
xmlns="http://www.w3.org/2005/01/pronunciation-lexicon"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2005/01/pronunciation-lexicon
http://www.w3.org/TR/2007/CR-pronunciation-lexicon-20071212/pls.xsd" alphabet="ipa" xml:lang="en-US">
<lexeme>
<grapheme>OSI model</grapheme>
<alias>o-s-i model</alias>
</lexeme>
<lexeme>
View lexicon1.pls
<?xml version="1.0" encoding="UTF-8"?>
<lexicon version="1.0"
xmlns="http://www.w3.org/2005/01/pronunciation-lexicon"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2005/01/pronunciation-lexicon
http://www.w3.org/TR/2007/CR-pronunciation-lexicon-20071212/pls.xsd" alphabet="ipa" xml:lang="en-US">
<lexeme>
<grapheme>PaaS</grapheme>
<alias>pass</alias>
</lexeme>
<lexeme>
@bluet
bluet / Database Naming Convention and Data Warehouse Design Principles.md
Last active Mar 3, 2021
Database Naming Convention and Data Warehouse Design Principles
View Database Naming Convention and Data Warehouse Design Principles.md
@KayLerch
KayLerch / en-US.js
Last active Feb 17, 2021
Optimized i18n request interceptor for Alexa custom skills in Node. Loads only required language assets from external files and provides some convenient functions to read them. Will also let you store localized settings represented as JSON objects in your language files.
View en-US.js
module.exports = Object.freeze({
translation: {
welcome: 'Howdy',
images: [
{
background: 'https://image/en-US.png'
},
{
background: 'https://image/en-US2.png'
},
@nafeu
nafeu / python3-script-template.py
Created Jan 29, 2019
Python3 Terminal Script Template
View python3-script-template.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Template for python3 terminal scripts.
This gist allows you to quickly create a functioning
python3 terminal script using argparse and subprocess.
"""
import argparse
View gimp_scale_stroke_batch.py
#!/usr/bin/python
# copy and paste into GIMP Python Console
# scales, sharpens, strokes, and exports all open images as PNGs
# optimized for processing screen grabs
# Filters > Python-Fu > Console
# pip install importlib
import importlib
View One import via join.yaml
Tags:
- Key: Name
Value:
!Join ['_', [ ec2, "Fn::ImportValue" : {"Fn::Sub":'${BaseStackName}-Environment'}, test2]]
#This will create a name tag with value: ec2_<yourValueFromOtherStack>_test2
View aimpolicy.json
{
"Version": "2012-10-17",
"Statement": [{
"Action": "ec2:*",
"Effect": "Allow",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:Region": [
"us-east-1",
View put_env_to_s3
#!/usr/bin/env ruby
require 'aws-sdk'
# initialize S3 client
s3_client = Aws::S3::Client.new(region: 'us-east-1')
# initialize KMS client
kms_client = Aws::KMS::Client.new(region: 'us-east-1')
@quiver
quiver / retrieve-EC2-region-information-from-metadata.md
Last active Apr 18, 2021
retrieve EC2's region from instance metadata
View retrieve-EC2-region-information-from-metadata.md

Sometimes you want to retrieve EC2 insntances' region information.

You can query that information through instance metadata(169.254.169.254).

$ curl --silent http://169.254.169.254/latest/dynamic/instance-identity/document
{
  "privateIp" : "172.31.2.15",
  "instanceId" : "i-12341ee8",
  "billingProducts" : null,
  "instanceType" : "t2.small",