Replace mcrypt_encrypt with openssl_encrypt
The url has changed: https://odan.github.io/2017/07/14/replace-mcrypt-encrypt-with-openssl-encrypt.html
The url has changed: https://odan.github.io/2017/07/14/replace-mcrypt-encrypt-with-openssl-encrypt.html
Public URL: | Github Gist |
---|---|
Status: | Incomplete |
Last Updated: | 2018-08-23 04:10 EDT |
DROP PROCEDURE IF EXISTS descend; | |
CREATE PROCEDURE descend(uid INT, depth INT) BEGIN | |
DROP TABLE IF EXISTS descendants; | |
DROP TABLE IF EXISTS children; | |
CREATE TEMPORARY TABLE descendants ( | |
id int, | |
parent_id int, | |
level int | |
) ENGINE = MEMORY; | |
INSERT INTO descendants(id, level) |
// by Erik Wrenholt | |
import java.util.*; | |
class Mandelbrot | |
{ | |
static int BAILOUT = 16; | |
static int MAX_ITERATIONS = 1000; | |
private static int iterate(float x, float y) | |
{ |
<?php | |
/** | |
* Подключение к БД | |
* | |
* @param $host | |
* @param $user | |
* @param $pass | |
* @param $db | |
* @return bool|resource | |
*/ |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
namespace strings2csv | |
{ | |
static class CSV | |
{ |
# Add the following 'help' target to your Makefile | |
# And add help text after each target name starting with '\#\#' | |
help: ## Show this help. | |
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | |
# Everything below is an example | |
target00: ## This message will show up when typing 'make help' | |
@echo does nothing |
// vanilla JavaScript | |
var links = document.links; | |
for (var i = 0, linksLength = links.length; i < linksLength; i++) { | |
if (links[i].hostname != window.location.hostname) { | |
links[i].target = '_blank'; | |
} | |
} | |
// or in jQuery |
<?php | |
/** | |
* Clean comments of json content and decode it with json_decode(). | |
* Work like the original php json_decode() function with the same params | |
* | |
* @param string $json The json string being decoded | |
* @param bool $assoc When TRUE, returned objects will be converted into associative arrays. | |
* @param integer $depth User specified recursion depth. (>=5.3) | |
* @param integer $options Bitmask of JSON decode options. (>=5.4) | |
* @return array/object |
<?php | |
// from http://php.net/manual/en/function.filesize.php | |
function formatBytes($bytes, $precision = 2) { | |
$units = array('B', 'KB', 'MB', 'GB', 'TB'); | |
$bytes = max($bytes, 0); | |
$pow = floor(($bytes ? log($bytes) : 0) / log(1024)); | |
$pow = min($pow, count($units) - 1); | |