Skip to content

Instantly share code, notes, and snippets.

View isramv's full-sized avatar
🐧

Israel M isramv

🐧
View GitHub Profile
@isramv
isramv / simple_social_share_example.md
Created February 5, 2016 18:50
Simple social share icons for D8 twig.

Simple social share icons D8.

hook_preprocess().

// Social share icons.
  if($hook == 'node') {
    if($vars['node']->getType() == 'resource') {
      global $base_root;
      $vars['base_root'] = $base_root;
      //
@isramv
isramv / settings.local.php
Created January 16, 2016 02:19
Example of D8 settings.local.php
<?php
/**
* @file
* Local development override configuration feature.
*
* To activate this feature, copy and rename it such that its path plus
* filename is 'sites/example.com/settings.local.php', where example.com
* is the name of your site. Then, go to the bottom of
* 'sites/example.com/settings.php' and uncomment the commented lines that
@isramv
isramv / template.php
Created November 17, 2015 18:45
Tempalte sugestions D8
<?php
use Drupal\Core\Url;
function hal_theme_theme_suggestions_select_alter(&$suggestions, &$vars, $hook)
{
// This will grab the view_id from the request
$request = \Drupal::request()->attributes->get('view_id');
if (!empty($request)) {
$suggestions[] = 'select__' . $request;
@isramv
isramv / mongo_on_mac_yosemite_10.10.4.md
Last active October 23, 2021 13:33
How to install mongodb on Mac Yosemite 10.10.4

how to install Mongo db on Mac Yosemite 10.10.4

I will be following the official documentation here but they take some things for granted, many users could get frustrated and confused that's why I created this gist.

I have downloaded the mongo files in my root user directory for example: /Users/israel/mongodb therefore if you want to do the same first enter cd in your terminal.

then enter pwd command in your terminal and you should be able to se something similar to /Users/<yourmacuser>

If the previous is correct you may want to proceed and open the terminal then download the tar:

@isramv
isramv / bubblesort
Last active August 29, 2015 14:20
JavaScript Bubble Sort Algorithm
arraynumbers = [5,2,1,4,9,12,4,3,2,12];
completed = false;
while(!completed) {
function reOrder() {
for (var i = 0; i < arraynumbers.length; i++) {
if(compareTwo(arraynumbers[i], arraynumbers[i+1]) || isEqual(arraynumbers[i], arraynumbers[i+1])) {
tmp = arraynumbers[i+1];
arraynumbers[i+1] = arraynumbers[i];
arraynumbers[i] = tmp;
console.log(arraynumbers);
@isramv
isramv / JavaScript Funcitons
Created April 27, 2015 05:28
JavaScript Functions and OOP with prototype examples
/** Module **/
var MyModule = (function() {
var DEFAULT = {
param: 'Hello World'
}
return {
name: 'Israel Morales!',
say: 'Because YOLO!',
speak: function() {
console.log('Hello World');
@isramv
isramv / how-to-hook_theme()
Last active August 29, 2015 14:19
How to theme a block Drupal 7 example
/**
* Function
*/
function myfunction() {
$variables = array(
'message' => 'Hi Bitches!',
'name' => 'Monk'
);
return theme('mobile-nav', $variables);
}
@isramv
isramv / gist:31e14f66d5db6f433e6e
Created April 17, 2015 20:44
Drop down menu squeleton SASS - Drupal
#block-system-main-menu {
ul.menu {
li {
display: inline-block;
padding-bottom: 9px;
ul {
display: none;
padding-left: 0;
background: #ffffff;
border: 1px solid #000000;
@isramv
isramv / gist:70dd9972f96bde4ee76a
Created February 5, 2015 12:27
Fixtures Example EmberJS
App.Person.reopenClass({
FIXTURES: [
{
id: 1,
name:'Israel Morales',
age: 30,
position: 'Web Developer',
gender:'Male',
},{
id: 2,