Skip to content

Instantly share code, notes, and snippets.

View devuri's full-sized avatar

uri devuri

  • Mexico
View GitHub Profile
@justsml
justsml / fetch-api-examples.md
Last active May 25, 2026 06:14
JavaScript Fetch API Examples
@studiopress
studiopress / functions.php
Last active March 13, 2018 09:53
Customize site footer with the Genesis Framework.
<?php
// Do NOT include the opening php tag.
// Remove site footer.
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );
// Customize site footer
add_action( 'genesis_footer', 'sp_custom_footer' );
@ricardojlrufino
ricardojlrufino / sso.php
Created September 1, 2017 04:48
phpMyAdmin SSO Login Example
<?php
$sso_server = "http://chat.local:8080/api/clients/validateDb";
/* Need to have cookie visible from parent directory */
session_set_cookie_params(0, '/', '', true, true);
/* Create signon session */
$session_name = 'SignonSession';
session_name($session_name);
@carlodaniele
carlodaniele / kinsta_users.php
Last active December 14, 2021 21:40
A plugin for registering a custom post type with a specific set of capabilities
<?php
/**
* @package Kinsta_users
* @version 1.0
*/
/*
Plugin Name: Kinsta users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@tomnomnom
tomnomnom / php-curl-crlf-injection.mkd
Last active July 31, 2026 07:48
CRLF Injection Into PHP's cURL Options

CRLF Injection Into PHP's cURL Options

I spent the weekend meeting hackers in Vegas, and I got talking to one of them about CRLF Injection. They'd not seen many CRLF Injection vulnerabilities in the wild, so I thought I'd write up an example that's similar to something I found a few months ago.

If you're looking for bugs legally through a program like hackerone, or you're a programmer wanting to write secure PHP: this might be useful to you.

@keithweaver
keithweaver / s3-upload-via-form.php
Created July 18, 2017 11:33
Upload image using form submission to AWS S3 with PHP
<?php
// This file demonstrates file upload to an S3 bucket. This is for using file upload via a
// file compared to just having the link. If you are doing it via link, refer to this:
// https://gist.github.com/keithweaver/08c1ab13b0cc47d0b8528f4bc318b49a
//
// 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
@keithweaver
keithweaver / s3-upload-via-link.php
Last active May 18, 2023 16:44
Upload image using link to AWS S3 with PHP
@jpalala
jpalala / create_users_table.php
Created April 26, 2017 10:17
Laravel migration create_users_table
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
@keithweaver
keithweaver / put-object-on-aws-s3.php
Last active June 17, 2026 16:09
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';
@devuri
devuri / http.php
Created April 14, 2017 00:21
simple http request example in php
<?php
/*
* simple HttpRequest example using PHP
* tom slankard
*/
class HttpRequest {
public $url = null;