Skip to content

Instantly share code, notes, and snippets.

View edutrul's full-sized avatar
💭
Changing the world

Eduardo Telaya edutrul

💭
Changing the world
View GitHub Profile
@edutrul
edutrul / SassMeister-input-HTML.html
Created July 29, 2014 17:40
Generated by SassMeister.com.
<body>
Hola mundo
</body>
@edutrul
edutrul / implement_post_contact
Created August 7, 2015 23:07
How to do a simple POST in REST?
Here's my script:
POST /livex/api/contact_form HTTP/1.1
Host: local.testdrupal.com
Content-Type: application/hal+json
Authorization: Basic bGl2ZXg6MTM1NzkwLi4=
Cache-Control: no-cache
Postman-Token: 1b64499c-5091-588e-f72e-e2202dc066b6
{
"_links": {
<?php
function mymodule_menu() {
$items['fancystuff/json/%'] = array(
'access callback' => true, // available to all
'page callback' => 'mymodule_fancystuff_object', // defined below
'page arguments' => array(2),
'delivery callback' => 'drupal_json_output'
);
return $items;
@edutrul
edutrul / exercise01 phparquitect.php
Last active October 3, 2015 01:32
exercise01 phparquitect
<?php
/**
* Exercise01.
*/
class Person {
protected $firstname;
protected $lastname;
public function __construct($firstname, $lastname) {
@edutrul
edutrul / CustomAdapter.java
Last active February 17, 2016 00:44
CUSTOM ADAPTER: IMAGE + TEXTVIEW
package com.example.autonoma.myapplication;
/**
* Created by Autonoma on 16/02/2016.
*/
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
@edutrul
edutrul / MainActivity.java
Created February 19, 2016 01:36
listview and http request SIMPLE in android
import android.content.Context;
import android.net.ConnectivityManager;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
@edutrul
edutrul / MainActivity.java
Created February 19, 2016 02:17
http UrlCOnnection with simplelistview and asynctask
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import org.json.JSONArray;
@edutrul
edutrul / MainActivity.java
Last active February 20, 2016 01:29
REST GET from android to DRUPAL with a simple LISTVIEW
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import org.json.JSONArray;
@edutrul
edutrul / drupal_8_httaccess
Created September 7, 2016 23:47
drupal 8 httaccess
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
@edutrul
edutrul / DefaultController.php
Created November 10, 2016 14:35
¿Cómo crear ventanas modales en drupal 8? (Actualizado)
<?php
// fyi: path src/Controller/DefaultConotroller.php
/**
* @file
* Contains Drupal\mymodule\Controller\DefaultController.
*/
namespace Drupal\mymodule\Controller;
use Drupal\Core\Controller\ControllerBase;