Skip to content

Instantly share code, notes, and snippets.

View adrianalonso's full-sized avatar

Adrián Alonso Vega adrianalonso

View GitHub Profile
@bdunogier
bdunogier / Blog post with customized fields.md
Last active July 7, 2019 19:48
eZ Platform GraphQL prototype
{
  content (id: 87) {
    fields {
      fieldDefIdentifier
      value {
        ... on TextLineFieldValue {
          value
        }
 ... on RichTextFieldValue {
@webdevilopers
webdevilopers / ElectricalEquipmentAdmin.php
Last active December 17, 2019 08:20
Override CRUDController to add custom form elements to list template for batch action usage in SonataAdminBundle
<?php
namespace Acme\DemoBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
class ElectricalEquipmentAdmin extends Admin
{
public function getTemplate($name)
{
@agustinhaller
agustinhaller / ParseImageURL.php
Created February 26, 2014 18:11
Given any image url, it returns the base64 image
<?php
// Given any image url, it returns the base64 image
function ParseImageURL()
{
// $image_url = (isset($_REQUEST["image_url"]) && $_REQUEST["image_url"]!=null) ? $_REQUEST["image_url"] : null;
$image_url = "https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-prn1/t1/p526x296/1965014_10153859707455111_1422873058_n.jpg";
// $image_url = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIWFRQBAwQEBgUGCgYGChAODA0QFA8OEAwNDQ8QDw0ODhANEA8MDA8PDxAQFA4VDw8PDhANDQ4ODRAQDw8UDhAMDA0MDP/AABEIACwALAMBEQACEQEDEQH/xAAaAAADAAMBAAAAAAAAAAAAAAAHCAkDBQYE/8QANBAAAQMDAwMCAwUJAQAAAAAAAQIDBAUGEQAHIQgSMRNBFCJxFzJCYYEVFiM0Q1FTcpEJ/8QAGgEAAgMBAQAAAAAAAAAAAAAAAwQABQYCAf/EACsRAAEDAwIEBQUBAAAAAAAAAAEAAgMREjEEIRNBUfBxgZGhwQUUImHRsf/aAAwDAQACEQMRAD8AfZtXA0wuFnR51FKrX3jd1N29s2uXRWFqbpVFgvVCUpsZV6baCtQSPdRAwB7kjUUUO7yvW/uszeebcc1Dji1r7I8NtwmPTI/4Gkk8ADyTgFSsnydIT6hkQq4+ATmn0z5zaweJ5BF66+gLcyltQbkiINXSyhC3YkBKlyEYGThJyFeM8YGST76Wh1okdu0jompdAWD8X
@yanofsky
yanofsky / LICENSE
Last active May 7, 2024 12:36
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@raphaelstolt
raphaelstolt / pre-commit
Created September 20, 2010 21:35
A pre-commit for running PHPUnit
#!/usr/bin/php
<?php
printf("%sGit pre-commit hook %1\$s", PHP_EOL);
$projectName = basename(getcwd());
exec('phpunit --configuration phpunit.xml', $output, $returnCode); // Assuming cwd here
if ($returnCode !== 0) {
$minimalTestSummary = array_pop($output);
printf("Test suite for %s failed: ", $projectName);
printf("( %s ) %s%2\$s", $minimalTestSummary, PHP_EOL);
return false; // exit(1);