Skip to content

Instantly share code, notes, and snippets.

View iambasilk's full-sized avatar
🎯
Building

Basil K iambasilk

🎯
Building
View GitHub Profile
@keithweaver
keithweaver / put-object-on-aws-s3.php
Last active May 18, 2023 19:20
Upload an image/object to an AWS S3 Bucket using PHP
<?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';
@bsara
bsara / git-ssh-auth-win-setup.md
Last active September 6, 2024 05:43
Setup SSH Authentication for Git Bash on Windows

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
  • .ssh/config
@simkimsia
simkimsia / annotate.php
Created June 22, 2012 07:45
annotate english or chinese text on image
<?php
header('Content-Type: text/html; charset=utf-8');
mb_internal_encoding('utf-8');
function wordWrapAnnotation(&$image, &$draw, $text, $maxWidth)
{
// separate the text by chinese characters or words or spaces
preg_match_all('/([\w]+)|(.)/u', $text, $matches);
// $words is array of Chinese characters, English Words or spaces
@taterbase
taterbase / upload.php
Created May 13, 2012 15:03
Simple file upload in php
<!DOCTYPE html>
<html>
<head>
<title>Upload your files</title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p>Upload your file</p>
<input type="file" name="uploaded_file"></input><br />
<input type="submit" value="Upload"></input>