Skip to content

Instantly share code, notes, and snippets.

View marinsagovac's full-sized avatar

Marin Sagovac marinsagovac

View GitHub Profile
@martinheld
martinheld / KongJwt.md
Last active February 21, 2024 14:47
Short example to use JWT with Kong

JWT Kong Example

  • Get and Start Kong and Co
git clone git@github.com:Mashape/docker-kong.git
cd docker-kong/compose
docker-compose up
  • Create Kong API Route
@bbottema
bbottema / Read ajax binary response data to base64
Created September 30, 2015 18:19
Complete example using FormData to post a variable and file to a service and parsing the binary result to base64
var formData = new FormData();
formData.append("user", "Mario");
formData.append("testdot", imgData);
createRequest("POST", "some webservice", callback).send(formData);
/*
* SOLUTION 1
*/
function callback(file) {
var reader = new FileReader();
@wowo
wowo / gender-module-installation.sh
Last active May 5, 2021 23:01
Guesing gender based on name in PHP
# install gender http://www.php.net/manual/en/book.gender.php
sudo apt-get install libpcre3-dev
sudo pecl install gender
# generate data
mkdir ~/gender
sudo pear run-scripts pecl/gender
# eneble module
echo 'extension=gender.so' >> /etc/php5/cli/php.ini
@hakre
hakre / iteration-and-recursive-iteration.php
Created September 2, 2012 14:26
Iteration and Recursive Iteration Examples Code
<?php
/*
* Iteration and Recursive Iteration Examples Code
*
* @link http://stackoverflow.com/questions/12077177/how-does-recursiveiteratoriterator-works-in-php
* @author hakre <http://hakre.wordpress.com>
*/
### To have these examples to work, a directory with subdirectories is needed,
### I named mine "tree":
@jimschubert
jimschubert / README.md
Created June 25, 2012 15:05
PyGTK image drag

This code was originally taken from a StackOverflow question here.

I'd like to also add image resize.

@Dreyer
Dreyer / mail-test.php
Created June 20, 2012 09:06
Quick & Dirty PHP Mail Test Script
<?php
/*
DONT FORGET TO DELETE THIS SCRIPT WHEN FINISHED!
*/
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = 'webmaster@example.com';
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
char* logo =
" ____ ____ ____ ____\n"
@dahnielson
dahnielson / UUID.php
Last active April 5, 2024 21:14
Pure PHP UUID generator
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4122 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.