This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eg: URL: yayhooray.net/#foo!bar | |
var $str = window.location.hash; | |
var $substr = $str.split('!'); | |
alert($str); // #foo!bar | |
alert($substr[0]); // #foo | |
alert($substr[1]); // bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['insert_post'] )) { //check that our form was submitted | |
$title = $_POST['thread_title']; //set our title | |
if ($_POST['thread_description']=="") { // check if a description was entered | |
$description = "See thread title..."; // if not, use placeholder | |
} else { | |
$description = $_POST['thread_description']; //if so, use it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"meta_id":6, | |
"post_id":10, | |
"meta_key":"_wp_page_template", | |
"meta_value":"default" | |
}, | |
{ | |
"meta_id":512, | |
"post_id":10, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
size: 'desktop', | |
widgets: | |
[ | |
{ | |
"w": 14, | |
"h": 24, | |
"x": 0, | |
"y": 0, | |
"i": "are_dashboard", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
lg: [ | |
{ i: 'are_dashboard', | |
x: 0, | |
y: 0, | |
w: 14, | |
h: 24 | |
}, | |
{ i: 'combined_are', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mobile Settings Array: | |
[{"i":"are_dashboard","x":0,"y":0,"w":12,"h":20},{"i":"combined_are","x":0,"y":20,"w":6,"h":16},{"i":"combined_tt","x":6,"y":20,"w":6,"h":16},{"i":"reset","x":0,"y":36,"w":6,"h":3,"isResizable":false},{"i":"time","x":0,"y":56,"w":6,"h":10},{"i":"news","x":6,"y":46,"w":6,"h":20},{"i":"school_switch","x":12,"y":36,"w":6,"h":10},{"i":"bookmarks","x":0,"y":39,"w":6,"h":17}] | |
Tablet Settings Array: | |
[{"i":"are_dashboard","x":0,"y":0,"w":6,"h":20},{"i":"combined_are","x":6,"y":0,"w":3,"h":20},{"i":"combined_tt","x":9,"y":0,"w":3,"h":20},{"i":"reset","x":0,"y":20,"w":6,"h":3,"isResizable":false},{"i":"time","x":0,"y":40,"w":6,"h":10},{"i":"news","x":6,"y":30,"w":6,"h":20},{"i":"school_switch","x":6,"y":20,"w":6,"h":10},{"i":"bookmarks","x":0,"y":23,"w":6,"h":17}] | |
Desktop Settings Array: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import {reduxForm, change} from 'redux-form'; | |
var { connect } = require('react-redux'); | |
var { fetchSchoolByID, saveSchool } = require('../../../reducers/school'); | |
export const fields = [ 'TrustID', 'LEAID', 'SchoolTypeId', 'Name', 'HeadTeacher', 'Email', 'Telephone', 'ImagePath', 'Notes' ]; | |
var form = reduxForm({ | |
form: 'schoolDetails', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hasClass, takes two params: element and classname | |
function hasClass(el, cls) { | |
return el.className && new RegExp("(\\s|^)" + cls + "(\\s|$)").test(el.className); | |
} | |
/* use like below */ | |
// Check if an element has class "foo" | |
if (hasClass(element, "foo")) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example ID | |
$id = '1'; | |
// DB connection and query | |
global $wpdb; | |
$rows = $wpdb->get_results( | |
" | |
SELECT $wpdb->postmeta.meta_key, $wpdb->postmeta.meta_value | |
FROM $wpdb->postmeta | |
WHERE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="css/normalize.min.css"> |
NewerOlder