Skip to content

Instantly share code, notes, and snippets.

View webratz's full-sized avatar

Andreas Sieferlinger webratz

View GitHub Profile
@CarlosDomingues
CarlosDomingues / local_bundler.py
Last active February 13, 2024 22:22
Implementing aws_cdk.core.ILocalBundling in Python (avoids using Docker for bundling)
from aws_cdk.core import (
BundlingDockerImage,
BundlingOptions,
ILocalBundling
)
from aws_cdk.aws_lambda import Code
from jsii import implements, member
@implements(ILocalBundling)
class MyLocalBundler:
@QuinnyPig
QuinnyPig / buildspec.yml
Last active October 16, 2018 04:43
The buildspec.yml that deploys Last Week in AWS.
version: 0.2
phases:
install:
commands:
- echo Entered the install phase...
- pip install -r requirements.txt
build:
commands:
- echo Entered the build phase...
@gbaman
gbaman / graphql_example.py
Created November 1, 2017 00:18
An example on using the Github GraphQL API with Python 3
# An example to get the remaining rate limit using the Github GraphQL API.
import requests
headers = {"Authorization": "Bearer YOUR API KEY"}
def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section.
request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers)
if request.status_code == 200:
@alces
alces / SetBuildEnvVars.groovy
Created December 1, 2016 07:48
Set environment variables during a Jenkins build using Groovy
// should be run as Groovy System Script
import hudson.EnvVars
import hudson.model.Environment
def build = Thread.currentThread().executable
def vars = [ENV_VAR1: 'value1', ENV_VAR2: 'value2']
build.environments.add(0, Environment.create(new EnvVars(vars)))
@foxwill
foxwill / OneLogin.py
Last active May 25, 2022 13:05
to create token object and use with the Users OAUTH api endpoint
import requests
class OneLogin(object):
def __init__(self, shard='US'):
"""
Specify the shard of the system being used (us or eu)
:param shard: us or eu
:return:
"""
@josephspurrier
josephspurrier / values_pointers.go
Last active April 28, 2024 16:41
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value