Skip to content

Instantly share code, notes, and snippets.

View remmel's full-sized avatar

Remy Mellet remmel

View GitHub Profile
@remmel
remmel / 1_extract-nw.sh
Last active July 22, 2022 17:39
Extract lifecast top left images to improve them using for example topaz; and then recreate with the improved image the lifecast rgbd frame
#!/bin/bash
# Extract north west of image / top left. Lifecast output jpgs must be in 0_out
# sudo apt install imagemagick
mkdir -p 1_nw
for f in 0_out/*.jpg
do
echo $f
convert $f -crop 1920x1920+0+0 1_nw/$(basename ${f})
done
@remmel
remmel / AppBundle.php
Last active August 19, 2016 16:14
Add YAML type in Doctrine (with Symfony)
namespace AppBundle;
use Doctrine\DBAL\Types\Type;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AppBundle extends Bundle
{
public function boot() {
Type::addType('yaml', 'AppBundle\Extension\YamlType');
$em = $this->container->get('doctrine.orm.default_entity_manager');
@remmel
remmel / facebook-messenger-bot.php
Last active November 5, 2021 18:01
Basic example of a Facebook Messenger Bot
<?php
// parameters
$hubVerifyToken = 'TOKEN123456abcd';
$accessToken = "xxx";
// check token at setup
if ($_REQUEST['hub_verify_token'] === $hubVerifyToken) {
echo $_REQUEST['hub_challenge'];
exit;
}