Skip to content

Instantly share code, notes, and snippets.

View Simple

Simple API - a mix of rest and RPC

There are a lot of time when you need a ton of actions but rest API docs with noun doesn't help much, and implementing proper RPC style will need a lot of changes and will not work for simple HTML forms.

Simple API spec

  1. HTTP GET for queries. GET requests are made in REST style.
AucT / bootstrap4-social-button-colors.css
Created Jan 13, 2020
css bootstrap 4 social buttons color
View bootstrap4-social-button-colors.css
.btn-google {
color: #fff;
background-color: #dc4639;
border-color: #dc4639;
.btn-google:hover {
color: #fff;
background-color: #cb3124;
border-color: #c02f22;
AucT / decompact.php
Last active Dec 12, 2019
decompact - replace php compact with array
View decompact.php
function decompact(...$params)
$minimumParamsForNewLines = 4;
$newLine = "\n";
if (count($params) < $minimumParamsForNewLines) {
$newLine = '';
View pageGenerationTime.php
$time_start = microtime(true);
//Your Content (i use sleep 2 seconds to for demo)
$time_end = microtime(true);
$time = $time_end - $time_start;
echo 'Page generated in: '.$time.' seconds';
View addYear.php
//Add 1 year
$future = date('Y-n-j', mktime(0,0,0, date('m'), date('d'), date('Y')+1));
echo $future;
AucT / index.html
Created Dec 7, 2016
jquery Ajax example
View index.html
<!doctype html>
<html class="no-js" lang="en">
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Simple Ajax Send Form</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
AucT / page_generation_time.php
Last active Sep 3, 2016
simple page generation time
View page_generation_time.php
$time_start = microtime(true);
//Your Content (i use sleep 2 seconds to for demo)
$time_end = microtime(true);
AucT / youtube_iframe.html
Created Aug 23, 2016
Youtube Iframe load on thumb click
View youtube_iframe.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>Youtube Iframe load on thumb click</title>
.youtube {
position: relative;
padding-bottom: 56.25%;
AucT / youtube-api-js.html
Created Jan 12, 2016
Youtube API js example
View youtube-api-js.html
<iframe id="player" type="text/html" width="640" height="390"
<iframe id="player2" type="text/html" width="640" height="390"
AucT /
Created Jan 12, 2016 — forked from benwong/
YouTube iFrame API wrapper for event videos
var EventYouTubeVideo = (function(){
var module = {};
module.init = function(){
var tag = document.createElement('script');
tag.src = "";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
You can’t perform that action at this time.