Skip to content

Instantly share code, notes, and snippets.

View samuelcotterall's full-sized avatar

Samuel Cotterall samuelcotterall

View GitHub Profile
var userInfo = passport.deserializeUser(function(id){
return id;
});
User.findById(userInfo, function(err, user) {
});
function cl_acf_set_language() {
return acf_get_setting('default_language');
}
function get_global_option($name) {
echo acf_get_setting('current_language'); // it
add_filter('acf/settings/current_language', 'cl_acf_set_language');
echo acf_get_setting('current_language'); // en
$option = get_field($name);
remove_filter('acf/settings/current_language', 'cl_acf_set_language');
echo acf_get_setting('current_language'); // it
$("#myformid").find("input, select").on('change', function(){
$("#myElement").addClass("myclass");
});
function newsPost_block_func() {
global $post;
$args = array();
$query = new WP_Query($args);
var_dump($query->have_posts());
}
add_shortcode( 'newsPost_block', 'newsPost_block_func');
function newsPost_block_func() {
global $post;
$args = array(
'post_type' => array( 'post' ),
);
$query = new WP_Query($args);
var_dump($query->have_posts());
}
add_shortcode( 'newsPost_block', 'newsPost_block_func');
.clear {clear:both;display:block;height:0pt !important;overflow:hidden;position:relative;width:auto;}
<!--
If the week view relies only on the user entering an H2...
-->
<td class="content">
<h3 class="weekdates">25 September - 1 October</h3>
<div class="summary">
<h2>Intro to Web Site Design</h2>
@samuelcotterall
samuelcotterall / gist:1156443
Created August 19, 2011 09:30
For Gemma…
To fix the width; find "width:47%;" and change it to "width:auto;" -- it is in this line:
#header{margin:0;border:0 solid $bordercolor;color:$pagetitlecolor;float:left;width:47%;overflow:hidden;}
I don’t know if this is intentional or not, but to fix the overlap hidden thing; change "padding:30px 0px;" to "padding:0 0 100px 0;" -- it is in this line:
@samuelcotterall
samuelcotterall / loop-increments-decremenet
Created September 9, 2011 14:27
Loop: Increment & Decrement
for (vari=0, j=len=items.length; i<len || j===0; i++, j--) {
console.log(i,j);
}
@samuelcotterall
samuelcotterall / bbedit-jsl
Created September 14, 2011 07:35
BBEdit JavaScript Lint
-- Based on John Gruber's PHP Syntax Checking script
-- from Daring Fireball
-- http://daringfireball.net/2003/12/php_syntax_checking_in_bbedit
-- Requires JavaScript Lint
-- http://www.javascriptlint.com/
-- Assumes it is installed at /usr/local/bin/jsl
-- requires OS >=10.4
-- Dual-licensed under the BSD or MIT licenses.