Skip to content

Instantly share code, notes, and snippets.

View isramv's full-sized avatar
🐧

Israel M isramv

🐧
View GitHub Profile
# Redirect for VM
# Old site
RewriteCond %{HTTP_HOST} ^videomind\.ooyala\.com$ [NC]
# New site
RewriteRule ^(.*)$ http%{ENV:protossl}://www.ooyala.com/videomind%1%{REQUEST_URI} [l,R=301]
@isramv
isramv / jQuery check if empty input add class
Last active June 14, 2022 23:37
Check if input has a value add and remove class jQuery
$('input#edit-keys-1').blur(function(){
tmpval = $(this).val();
if(tmpval == '') {
$(this).addClass('empty');
$(this).removeClass('not-empty');
} else {
$(this).addClass('not-empty');
$(this).removeClass('empty');
}
});
@isramv
isramv / Views Query Alter
Created September 22, 2014 19:54
Views Query Alter for Drupal example.
<?php
/*
* Implements hook_views_query_alter();
*
*/
function custom_partnerportal_views_query_alter(&$view, &$query) {
if ($view->name == 'taxonomy_term') {
global $user;
$usuario = user_load($user->uid);
$categories = $usuario->field_category['und'];
<?php
/**
* Implements hook_menu().
*/
function mymodule_menu() {
$items['mymodule/%ctools_js/add'] = array(
'page callback' => 'mymodule_node_add_modal_callback',
'page arguments' => array(1),
'access arguments' => array('access content'),
@isramv
isramv / css
Created October 8, 2014 23:03
Sticky menu with jQuery.
.fixedMenu {
position:fixed;
background:white;
z-index:1000;
width:100%;
top:0;
}
@isramv
isramv / gist:891293f1076ae70d713b
Created February 4, 2015 04:06
emberjs RESTSerializer example
App.ArticleSerializer = DS.RESTSerializer.extend({
extractArray: function(store, type, payload) {
articles = payload;
data = [];
articles.forEach(function(article) {
tempObj = {
id: article.nid,
title: article.title,
Body: article.Body
@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,
@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 / 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 / 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');