Skip to content

Instantly share code, notes, and snippets.

@rabehasy
rabehasy / removeArrayByKey.php
Created September 27, 2017 09:13
PHP - remove array_value by key and values in lists
<?php
/**
* remove array_value by key and values
*
* @param array $arr - array
* @param string $key - Key
* @param string $lists - value lists
*
* @return array
*/
/**
* From: https://github.com/mikehaertl/php-shellcommand/blob/master/src/Command.php
* @return bool whether we are on a Windows OS
*/
function getIsWindows()
{
return strncasecmp(PHP_OS, 'WIN', 3)===0;
}
@rabehasy
rabehasy / gist:746aa20304d77fd6b964038cfcc129ec
Last active December 12, 2017 21:13
Upgrade PHP 7.1 on XAMPP 3.2.2
Download php 7.1
Extract zip and put all files in c:/xampp/php71
Update php_apcu.dll
Update php_ssh2.dll
Update c:\windows\php.ini - replace all occurence of C:\xampp\php to C:\xampp\php71
Edit C:\xampp\apache\conf\extra\httpd-xampp.conf - replace all occurence of C:\xampp\php to C:\xampp\php71
In C:\xampp\php71\php.ini - uncomment :
- extension=php_curl.dll
- extension=php_mbstring.dll
- extension=php_mysqli.dll
@rabehasy
rabehasy / createWriteQuery.php
Last active March 21, 2019 17:27
PHP - Generate write query (insert....) from SELECT mysql
<?php
class PDO2 extends PDO {
private static $_instance;
/* Constructeur : héritage public obligatoire par héritage de PDO */
public function __construct( ) {
}
// End of PDO2::__construct() */
/* Singleton */
public static function getInstance() {

title: Angular-ElectronJS - Login API REST jwt tags:

  • angular
  • electronjs
  • fontawesome categories:
  • angular
  • electronjs permalink: angular-electronjs-login-form-validation
hexo.extend.tag.register('googleads', function(args) {
if (args.length !== 3) {
return '';
}
let layout = args[0]; // ex: in-article
let format = args[1]; // ex: fluid
let slot = args[2];
<title>Madatsara</title>
<app-root>Loading...</app-root>
<app-root>
<style>
app-root {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
color: pink;
text-transform: uppercase;
<?php
/**
* add crontab -- * * * * * php /home/web/githooks.php
*/
$folder = __DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR;
// Go to miaryrabs; pull and remove files inside tmp
$cmd = 'cd /home/web/miaryrabs/; git pull gitlab master; rm -rf ' . $folder . '*';
// if calling from php cli