Skip to content

Instantly share code, notes, and snippets.

View dovidezra's full-sized avatar
💭
I may be slow to respond.

Dovid Ezra dovidezra

💭
I may be slow to respond.
  • Diaspora
View GitHub Profile
@dovidezra
dovidezra / minify.php
Created October 8, 2022 05:01
CSS Minifier PHP Example: Check the example on how to use PHP to minify a CSS hardcoded string and output to stdout
<?php
$url = 'https://www.toptal.com/developers/cssminifier/api/raw';
// init the request, set various options, and send it
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
@dovidezra
dovidezra / gregoriantojd.php
Last active April 26, 2022 01:10
PHP: Covert Current Gregorian Date to Jewish Calendar Date
<?php
$month = date('m');
$day = date('d');
$year = date('Y');
function isJewishLeapYear($year) {
if ($year % 19 == 0 || $year % 19 == 3 || $year % 19 == 6 ||
$year % 19 == 8 || $year % 19 == 11 || $year % 19 == 14 ||
$year % 19 == 17)
@dovidezra
dovidezra / fakeigniter.php
Created September 10, 2019 06:48 — forked from tinkertim/fakeigniter.php
A fake Codeigniter framework for testing codeigniter-redis
<?php
error_reporting(E_ALL);
/**
* A 'fake' Codeigniter framework for testing codeigniter-redis
* I seriously wrote this because it was faster than setting up another CI install, so I can
* work on it without breaking stuff that other people are using.
* Written by Tim Post <tpost@ezp.net> I take no responsibility for what comes below!
**/
/* Provide some of the CI common functions */
@dovidezra
dovidezra / otp-auth.php
Last active December 24, 2017 18:41
(OTP-Auth) Easily Create One-Time Password System in PHP App
<?php
/**
* Name: (OTP-Auth) One-Time Password Authentication
* Auth: Jason Jersey
* Date: 12-24-2017
* Link: https://gist.github.com/icryptix/130fa81ca15925b8553bec8700e5813d
*/
/* Verifying whether OTP 1 hour cookie is set */
if(isset($_COOKIE["sitename_otp_cookie"])){
@dartiss
dartiss / functions.php
Created November 15, 2017 18:15
WordPress Plugin to List all Site Cookies
<?php
function get_cookies( $paras = '', $content = '' ) {
if ( strtolower( $paras[ 0 ] ) == 'novalue' ) { $novalue = true; } else { $novalue = false; }
if ( $content == '' ) { $seperator = ' : '; } else { $seperator = $content; }
$cookie = $_COOKIE;
ksort( $cookie );
@dovidezra
dovidezra / ERR_EMPTY_RESPONSE
Last active July 15, 2017 23:54
Fix ERR_EMPTY_RESPONSE by using CMD
Go to START MENU
Go to RUN
Type CMD
Run below 6 commands one by one. Copy and paste them one by one into CMD and click ENTER after adding each.
(In CMD, you just have to click with your right mouse button to paste)
ipconfig /release
ipconfig /all
ipconfig /flushdns
@dovidezra
dovidezra / ERR_SOCKET_NOT_CONNECTED
Last active July 13, 2017 23:09
ERR_SOCKET_NOT_CONNECTED
1. Go to the start menu
2. Go to your browser
3. Click on it and open it up
4. Type this following command in the browsers address bar. This is the same place you normally type in https://www.mydomain.com
chrome://net-internals/#sockets
5. Click “Flush Socket Pools”, located at the Top of the screen.
6. Restart browser
https://support.cloudflare.com/hc/en-us/requests
https://support.cloudflare.com/hc/en-us/requests/new
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Off Canvas Reveal Menu Template for Bootstrap</title>
@dovidezra
dovidezra / gist:44e4b3cc546fa2913cf200e34fa5da02
Created June 1, 2017 18:11
Converting an Existing Table to Innodb
ALTER TABLE table_name ENGINE=InnoDB;