Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jaschaio's full-sized avatar
💪
Productive

Jascha Brinkmann jaschaio

💪
Productive
View GitHub Profile
@maxivak
maxivak / __upload_file.md
Last active April 4, 2024 10:07
PHP upload file with curl (multipart/form-data)

We want to upload file to a server with POST HTTP request. We will use curl functions.


// data fields for POST request
$fields = array("f1"=>"value1", "another_field2"=>"anothervalue");

// files to upload
$filenames = array("/tmp/1.jpg", "/tmp/2.png");
@int128
int128 / README.md
Last active January 21, 2024 14:52
Watching build mode on Create React App

Create React App does not provide watching build mode oficially (#1070).

This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.

How to Use

Create a React app.

Put the script into scripts/watch.js.

@ahmadawais
ahmadawais / upload-a-file.MD
Created June 18, 2017 11:07 — forked from websupporter/upload-a-file.MD
Upload a file using the WordPress REST API

Upload files

Using the REST API to upload a file to WordPress is quite simple. All you need is to send the file in a POST-Request to the wp/v2/media route.

There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:

@tmaiaroto
tmaiaroto / Dockerfile
Last active June 30, 2022 08:48
WordPress on Amazon ECS
FROM alpine:3.3
MAINTAINER Tom Maiaroto <tom@outdoorsy.co>
# Install packages
RUN apk --update --repository http://dl-3.alpinelinux.org/alpine/edge/main add \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
php7 \
@cristianstan
cristianstan / Simple Ajax Login Form.php
Last active October 12, 2023 00:09
Wordpress: Simple Ajax Login Form
<?php
//Simple Ajax Login Form
//Source: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/
?>
//html
<form id="login" action="login" method="post">
<h1>Site Login</h1>
<p class="status"></p>
<label for="username">Username</label>
@jedp
jedp / gist:3005816
Created June 27, 2012 18:18
postMessage() security review checklist

Security-Reviewing Uses of postMessage()

The postMessage() API is an HTML5 extension that permits string message-passing between frames that don't share the same origin. It is available in all modern browsers. It is not supported in IE6 and IE7.

postMessage is generally considered very secure as long as the programmer is careful to check the origin and source of an arriving