Skip to content

Instantly share code, notes, and snippets.

@rabehasy
rabehasy / index.html
Created March 2, 2021 14:14
Sortable: `put: []` demo // source https://jsbin.com/rayuvob
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Sortable: `put: []` demo</title>
<!-- Sortable.js -->
<script src="https://raw.githack.com/SortableJS/Sortable/master/Sortable.js"></script>
<?php
namespace Miary;
class ArgsmissingException extends \Exception
{
public function __construct($message = "")
{
parent::__construct($message);
}
<?php
namespace Miary;
class SourcemissingException extends \Exception
{
public function __construct($message = "")
{
parent::__construct($message);
}
<?php
/**
* Usage :
* php src/scriptmagick.php "source" "destination"
*/
namespace Miary;
require_once __DIR__.'/../vendor/autoload.php';
use Symfony\Component\Process\Process;
@rabehasy
rabehasy / cpRs.js
Last active December 17, 2019 14:03
#!/usr/bin/env node
/**
* This script can be run on windows machine
* It simulates the command 'cp -Rs' in linux
* This command create a symlink for each files from one folder to another one
*/
/**
* package.json
{
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutterapp">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
<select name="musique" class="select2">
<option value="1">Guitare</option>
<option value="2">Harmonica</option>
<option value="3">Piano</option>
<option value="4">Flute</option>
<option value="5">Violon</option>
<option value="6">Trompette</option>
<option value="7">Saxophone</option>
<option value="8">Batterie</option>
<option value="9">Accordéon</option>
<ul>
<li>
titre 1 - 2018-11-01
</li>
<li>
titre 2 - 2018-11-02
</li>
<li>
titre 3 - 2018-11-01
</li>
<ul>
<f:for each="{news}" as="new" iteration="iterator">
<li style="{f:if(condition: '{iterator.index} > 4', then: 'display: none', else: '')}">
{new.title} - {new.date}
</li>
</f:for>
</ul>
<?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