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
AngularJS Best Practices | |
http://trochette.github.io/Angular-Design-Patterns-Best-Practices/#/intro | |
Redirect http traffic to https | |
https://www.ndchost.com/wiki/apache/redirect-http-to-https | |
public function printIt($data){ | |
echo "<pre>"; | |
print_r($data); | |
echo "</pre>"; | |
} | |
public function console($data){ | |
$data = json_encode($data); | |
echo "<script type='text/javascript'>console.log($data)</script>"; | |
} |
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
<?php | |
public function getEmbedCode($url) | |
{ | |
if (strpos($url, 'youtube') !== FALSE) { | |
$url_parts = parse_url($url); | |
parse_str($url_parts['query'], $segments); | |
return '//www.youtube.com/embed/' . $segments['v']; | |
} else if (strpos($url, 'vimeo') !== FALSE) { |
<!-- LIBRARY --> | |
<? | |
if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
class MY_Upload extends CI_Upload { | |
function uploadmultiple($files, $settings) | |
{ | |
$uploaded = array(); | |
<?xml version="1.0" encoding="UTF-8"?> | |
<jobs> | |
<job> | |
<id>2342342</id> | |
<action>add</action> | |
<user_id>116555</user_id> | |
<start>2007-08-30</start> | |
<expire>2007-08-30</expire> | |
<position> | |
<![CDATA[Job Title Here]]> |
<? | |
global $post; | |
$events = new WP_Query(); | |
$events->query( array('post_type'=> 'tribe_events', 'eventDisplay' => 'all', 'posts_per_page' => 3)); | |
if ( $events->have_posts() ){ | |
echo "<ul>"; | |
while ( $events->have_posts() ) | |
{ |
var a = document.getElementsByTagName("a"); | |
for (var i = 0; i < a.length; i++) | |
{ | |
a[i].onclick=function(){ | |
window.location = this.getAttribute("href"); | |
return false; | |
} | |
} |
/* CSS */ | |
body { padding-top:80px; } /* be sure the padding is fron the top of the page to the top of your content */ | |
#header { position: absolute; height:50px; width: 100%; top:20px; left:0; right:0; } | |
#header.fixed { position: fixed; top:0; } |