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
{ | |
"swagger": "2.0", | |
"info": { | |
"title": "API", | |
"contact": {} | |
}, | |
"host": "http://localhost:9000", | |
"paths": { | |
"/basics/cars/upstream": { | |
"get": { |
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
<?php | |
$BUCKET_NAME = ''; | |
$IAM_KEY = ''; | |
$IAM_SECRET = ''; | |
require '/vendor/autoload.php'; | |
use Aws\S3\S3Client; | |
use Aws\S3\Exception\S3Exception; | |
// Get the access code |
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
<?php | |
// Installed the need packages with Composer by running: | |
// $ composer require aws/aws-sdk-php | |
$filePath = "https://example.com/test.png"; | |
require 'vendor/autoload.php'; | |
$bucketName = 'YOUR_BUCKET_NAME'; | |
$filePath = './YOUR_FILE_NAME.png'; |
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
<?php | |
// This file demonstrates file upload to an S3 bucket. This is for using file upload via a | |
// link compared to actually having the image file content. If you are doing it via image | |
// file upload, like getting the file from $_FILE, refer to this: | |
// https://gist.github.com/keithweaver/70eb06d98b008113ce97f6148fbea83d | |
// | |
// You must setup your bucket to have the proper permissions. To learn how to do this | |
// refer to: | |
// https://github.com/keithweaver/python-aws-s3 | |
// https://www.youtube.com/watch?v=v33Kl-Kx30o |
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 os | |
def doesFileExists(filePathAndName): | |
return os.path.exists(filePathAndName) | |
# Example | |
if doesFileExists('./test.json'): | |
print ('Yaa it exists!') | |
else: | |
print ('Nope! Not around') |
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
# Uses Bluez for Linux | |
# | |
# sudo apt-get install bluez python-bluez | |
# | |
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/x232.html | |
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/c212.html | |
import bluetooth | |
def receiveMessages(): |
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
# I tried to use the pip install wifi but it really didn't work. | |
# So created this | |
import subprocess | |
process = subprocess.Popen(['/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport','-I'], stdout=subprocess.PIPE) | |
out, err = process.communicate() | |
process.wait() | |
print(out) | |
''' |
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
// This is for changing gravity direction on the Y axis for | |
// a particular object. | |
// This is for Unity. | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class CharacterMovement : MonoBehaviour { | |
float FORCE_OF_GRAVITY = 9.8F; |
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
# For more info: http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html | |
import cv2 | |
import numpy as np | |
import os | |
FILE_OUTPUT = 'output.avi' | |
# Checks and deletes the output file | |
# You cant have a existing file or it will through an error | |
if os.path.isfile(FILE_OUTPUT): |
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
<?php | |
// You need to install the sendgrid client library so run: composer require sendgrid/sendgrid | |
require '/vendor/autoload.php'; | |
// contains a variable called: $API_KEY that is the API Key. | |
// You need this API_KEY created on the Sendgrid website. | |
include_once('./credentials.php'); | |
$FROM_EMAIL = 'YOUR_EMAIL'; | |
// they dont like when it comes from @gmail, prefers business emails |