Skip to content

Instantly share code, notes, and snippets.

View elalemanyo's full-sized avatar
🥘
NaN

victor elalemanyo

🥘
NaN
View GitHub Profile
@coreyworrell
coreyworrell / gist:1313678
Created October 25, 2011 18:06
JW Player - Stop other videos when playing
View gist:1313678
(function($) {
/**
* We have to get a collection of id's because the HTML5 player moves the DOM
* around and returns different elements when caching the selectors.
*/
var elements = $('.video-player > div, .video-player object'),
playerIds = [];
elements.each(function(i, player) {
playerIds.push(player.id);
@pascalduez
pascalduez / demo.module
Created December 24, 2011 15:02
Drupal 7 — Basic Ajax form submit (Ajax framework)
View demo.module
<?php
/**
* @file
* Demo module, Basic Ajax form submit (Ajax framework).
*/
/**
* Implements hook_menu().
*/
@saetia
saetia / gist:1623487
Last active December 24, 2023 07:36
Clean Install – OS X 10.11 El Capitan
View gist:1623487

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@waako
waako / template.php
Created February 3, 2012 18:15
Drupal, get theme path in javascript
View template.php
<?php
function theme_preprocess_page(&$variables) {
drupal_add_js('jQuery.extend(Drupal.settings, { "pathToTheme": "' . path_to_theme() . '" });', 'inline');
}
?>
@pascalduez
pascalduez / modulename.module
Created February 22, 2012 23:33
Drupal 7 - Add a cancel button on node forms
View modulename.module
<?php
/**
* Implements hook_form_alter().
*/
function modulename_form_alter(&$form, &$form_state, $form_id) {
// You might want to filter by content type.
if ($form_id == 'ctype_node_form') {
// Add a cancel button.
$form['actions']['cancel'] = array(
@mrconnerton
mrconnerton / gist:1979037
Last active December 4, 2018 15:13
node form in ctools modal drupal 7
View gist:1979037
<?php
/*
Make Sure you include:
ctools_include('modal');
ctools_modal_add_js();
On the pages you put your link.
*/
@snirgel
snirgel / jquery.mirrorvalue.js
Created March 14, 2012 11:03
Mirrors the input of an textfield, identified by id
View jquery.mirrorvalue.js
/**
* @author Karina Mies
* @description Mirrors the input of an textfield, identified by id
*/
jQuery.fn.mirrorValue = function(){
return this.each(function(){
var lCurrentText, lId, lMirrorClass;
jQuery(this).keyup(function(e) {
lId = '#'+jQuery(this).attr('id');
lMirrorClass = '.'+jQuery(this).attr('id')+'-mirror';
View ios-8-web-app.html
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@kellec
kellec / examples-and-output.css
Created April 12, 2012 02:10
a LESS mixin for versatile gradients (with IE support)
View examples-and-output.css
/* Basic two stop gradient */
.example-gradient {
.linear-gradient(150deg, #eee, #aaa);
}
/* Outputs */
.example-gradient {
background: -webkit-linear-gradient(150deg, #EEE 0%, #AAA 100%);
background: -moz-linear-gradient(150deg, #EEE 0%, #AAA 100%);
background: -ms-linear-gradient(150deg, #EEE 0%, #AAA 100%);
background: -o-linear-gradient(150deg, #EEE 0%, #AAA 100%);
@ykarikos
ykarikos / png2svg.sh
Created June 7, 2012 22:17
Convert png to svg using imagemagick and potrace
View png2svg.sh
#!/bin/bash
if [ "$1" == "" ]; then
echo Usage: $0 pngfile
exit 0;
fi
FILE=`basename $1 .png`
if [ ! -e $FILE.png ]; then