Skip to content

Instantly share code, notes, and snippets.

View roxberry's full-sized avatar
💭
coding

Mark Roxberry roxberry

💭
coding
View GitHub Profile
@Riebart
Riebart / apigateway-invoke.py
Last active May 30, 2023 12:21
Python script to invoke an AWS API Gateway endpoint that requires IAM authentication. Uses boto for signing the request, and requests for issuing it.
#!/usr/bin/env python3
"""
Provides a simple Python wrapper for invoking an API Gateway endpoint using IAM signed requests.
Example:
python3 apigateway-invoke.py GET \
https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/default/MethodName | jq .
"""
try:
@pedrohma
pedrohma / geoLocation.js
Last active June 2, 2023 11:18
Getting Zip Code by GeoLocation using Google Maps API
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
alert("Sorry, but Geolocation is not supported by this browser.");
}
}
function showPosition(position) {
var lat = position.coords.latitude;
@tonysneed
tonysneed / Mac OS X: Open in Visual Studio Code
Last active June 14, 2024 04:16
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@guardrex
guardrex / tasks.json
Last active April 29, 2019 10:54
VS Code Tasks file to work with dotnet cli
{
"version": "0.1.0",
"command": "cmd",
"isShellCommand": true,
"showOutput": "silent",
"args": [
"/c"
],
"tasks": [
{
@B-Con
B-Con / Credit Card Generator
Last active September 24, 2022 13:02
This JavaScript function generates random number strings that pass the Luhn checksum, the test that credit card numbers must conform to. It assumes there is an HTML radio input to indicate which company issued the card. This code is from my webpage here: http://bradconte.com/cc_generator.html.
// Copyright (c) 2015, Brad Conte (http://bradconte.com)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.