Skip to content

Instantly share code, notes, and snippets.

View isramv's full-sized avatar
🐧

Israel M isramv

🐧
View GitHub Profile
@isramv
isramv / gist:0ba4354bc73a8210272efd143a871708
Created February 13, 2017 22:08
path api drupal 8 jsonapi
<?php
/**
* @file
*
* Contains \Drupal\path_rest\Controller\PathRestController.
*
*/
namespace Drupal\path_rest\Controller;
@isramv
isramv / VIA-25.md
Last active January 24, 2017 23:26
 ~/S/a/viamagazine   features/VIA25_disable-dev-modules ±  drush @aaavia.local cim
 Collection  Config                                                    Operation
             search_api.server.acquia_search_api_solr_server           create
             core.extension                                            update
             simple_sitemap.bundle_settings.node.article               update
             simple_sitemap.bundle_settings.node.blog                  update
             security_review.settings                                  delete
             security_review.check.security_review-views_access        delete
             security_review.check.security_review-upload_extensions   delete
#!/usr/bin/env bash
echo ">>> Installing Mailhog"
# Download binary from github
wget --quiet -O ~/mailhog https://github.com/mailhog/MailHog/releases/download/v0.2.1/MailHog_linux_amd64
# Make it executable
chmod +x ~/mailhog
@isramv
isramv / vueform.js
Created August 11, 2016 22:52
Example vuejs
<template>
<div>
<div class="row actions">
<div class="col-xs-4 col-xs-offset-8">
<!-- todo fix the cancel button. -->
<button class="btn-sm btn btn-default btn-sm" v-on:click="cancelAction">Cancel</button>
<button class="btn-sm btn btn-default btn-sm" v-on:click="createAction">Save</button>
</div>
</div>
<i class="fa fa-circle-o-notch fa-spin fa-2x fa-fw" v-if="processing"></i>
@isramv
isramv / week_of.module
Created June 17, 2016 20:07
Computed values drupal 7 node presave
<?php
function week_of_form_alter(&$form, &$form_state, $form_id) {
if($form_id == 'eligible_post_node_form') {
$form['field_week_of']['#access'] = FALSE;
}
}
function week_of_node_presave($node) {
if($node->type == "eligible_post") {
@isramv
isramv / BPaginator.php
Last active June 13, 2016 18:23
Simple Symfony Paginator - Symfony 2.8
<?php
namespace BetterGistsBundle\DependencyInjection;
use Doctrine\ORM\EntityRepository;
class BPaginator
{
/**
* @var $offset
@isramv
isramv / font-awesome social round icons css.md
Created May 10, 2016 23:09
FontAwesome round social icons

Credits here: FortAwesome/Font-Awesome#4167

I agree. Use Pure css, with border-radius and a fixed width and height.

For example:

.social [class*="fa fa-"] {
    background-color: #333;
 border-radius: 30px;
@isramv
isramv / drupal-7-example-local-settings.php
Last active May 4, 2016 19:15 — forked from delphian/drupal-7-example-local-settings.php
Example of drupal 7 local settings.php file.
<?php
// To set up a local environment, make a duplicate of this file and name it
// local-settings.inc in the site directory that contains the settings.php file.
// Ignore sites/*/local-settings.php in the .gitignore file. Change the settings.php
// file to include local-settings.php if the file exists.
// Point database to local service.
$databases['default']['default'] = array(
'database' => 'local_db_name',
@isramv
isramv / ablog_theme.md
Last active March 16, 2016 17:47
Ablog theme.
@isramv
isramv / template_suggestion.php
Created February 19, 2016 00:04
Template suggestion twig.
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function ixia_theme_suggestions_eck_entity_alter(array &$suggestions, array $vars, $hook) {
$entity = $vars['entity']['#slice'];
if(in_array('eck_entity__slice__resources_slice', $suggestions)) {
$template_suggestion_array = $entity->field_template_suggestion->getValue();
$template_lenght = count($template_suggestion_array);
if($template_lenght) {