Skip to content

Instantly share code, notes, and snippets.

View btribouillet's full-sized avatar

Brieuc Tribouillet btribouillet

View GitHub Profile
@btribouillet
btribouillet / camera_view.dart
Created February 19, 2021 09:27 — forked from aravindhkumar23/camera_view.dart
Flutter Camera view with + button to open gallery (captured image and gallery picked image will be shown in horizontal scrollable view in bottom like whatsapp)
import 'dart:async';
import 'dart:io';
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:path_provider/path_provider.dart';
import '/utils.dart';
@aravindhkumar23
aravindhkumar23 / camera_view.dart
Last active March 19, 2021 20:44
Flutter Camera view with + button to open gallery (captured image and gallery picked image will be shown in horizontal scrollable view in bottom like whatsapp)
import 'dart:async';
import 'dart:io';
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:path_provider/path_provider.dart';
import '/utils.dart';
@aggarwalankush
aggarwalankush / Sql.ts
Last active December 19, 2019 12:33
Ionic 2 storage
import {Injectable} from "@angular/core";
import {Platform} from "ionic-angular";
const DB_NAME: string = '__mydbname';
const win: any = window;
@Injectable()
export class Sql {
private _dbPromise: Promise<any>;
@n0ni0
n0ni0 / .travis.yml
Last active November 11, 2019 10:14
Travis-CI file for PHP/Symfony 3
# Project language
language: php
# Allows use container-based infrastructure
sudo: false
# Start mysql service
services:
- mysql
@kokers
kokers / gallery.php
Last active April 16, 2021 15:56
ACF Pagination Gallery with categories
@ArnaudBan
ArnaudBan / admin-script.js
Last active September 23, 2015 14:46
Use the WordPress Media manager
/*
*
* Code générique qui permet d'utiliser le gestionnaire de media de WordPress
*
* Pour que ce code marche il faut ajouter le scripts de WordPress ( wp_enqueue_media() )
* et respecter quelques régles pour le HTML ( voir les fichier exemple.php et functions.php )
*
*/
var custom_uploader, name, input, size, preview;
@asugai
asugai / Install composer on Amazon AMI running on EC2
Last active March 22, 2024 03:37
Install composer on Amazon AMI running on EC2
$ cd ~
$ sudo curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install
@justintadlock
justintadlock / register-post-type.php
Last active October 22, 2023 05:55
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@timonweb
timonweb / gist:2623793
Created May 6, 2012 18:55
Django: Programmatically saving image from URL to FileField or ImageField http://twigstechtips.blogspot.com/2012/04/django-programmatically-saving-image.html
class Product(models.Model):
# other fields
image = models.FileField(storage = MogileFSStorage(), upload_to = 'product_images')
from django.core.files import File
from django.core.files.temp import NamedTemporaryFile
product = Product()
# set all your variables here
product.save()
<?php
namespace ExampleBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
use ExampleBundle\Form\EventListener\addTranslatedFieldSubscriber;