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
(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); |
<?php | |
/** | |
* @file | |
* Demo module, Basic Ajax form submit (Ajax framework). | |
*/ | |
/** | |
* Implements hook_menu(). | |
*/ |
<?php | |
function theme_preprocess_page(&$variables) { | |
drupal_add_js('jQuery.extend(Drupal.settings, { "pathToTheme": "' . path_to_theme() . '" });', 'inline'); | |
} | |
?> |
<?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( |
<?php | |
/* | |
Make Sure you include: | |
ctools_include('modal'); | |
ctools_modal_add_js(); | |
On the pages you put your link. | |
*/ |
/** | |
* @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'; |
<!doctype html> | |
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
<html> | |
<head> | |
<title>iOS 8 web app</title> | |
<!-- CONFIGURATION --> |
/* 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%); |
#!/bin/bash | |
if [ "$1" == "" ]; then | |
echo Usage: $0 pngfile | |
exit 0; | |
fi | |
FILE=`basename $1 .png` | |
if [ ! -e $FILE.png ]; then |