Skip to content

Instantly share code, notes, and snippets.

View isramv's full-sized avatar
🐧

Israel M isramv

🐧
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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) {
@isramv
isramv / ablog_theme.md
Last active March 16, 2016 17:47
Ablog theme.
@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 / 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;