Skip to content

Instantly share code, notes, and snippets.

@setola
setola / buildpath.xml
Created October 14, 2012 13:48
WordPress Eclipse Code Completion
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
<buildpathentry kind="src" path=""/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
<buildpathentry external="true" kind="lib" path="C:/Program Files/eclipse/workspaces/webdev/WordPress/wordpress-3.4.2"/>
</buildpath>
@setola
setola / ipfilter.apacheconf
Last active December 12, 2015 07:48
PHPMyAdmin safe config on Ubuntu Server
<Directory /usr/share/phpmyadmin>
Order allow,deny
Allow from 192.168.1.0/24
</Directory>
int pulPin = 10;
int dirPin = 11;
int enblPin = 12;
int ledPin = 13;
int loops = 0;
void setup() {
// put your setup code here, to run once:
pinMode(pulPin, OUTPUT);
@setola
setola / wp-config.php
Last active June 27, 2016 14:44
WordPress - Enable custom repository from local ip
<?php
/** Enable my local themes and plugins repository FFS!!! */
add_filter( 'http_request_host_is_external', 'allow_my_custom_host', 10, 3 );
function allow_my_custom_host( $allow, $host, $url ) {
if ( $host == 'put.your-repository-domain-here.com' )
$allow = true;
return $allow;
}
@setola
setola / popover.html
Created March 26, 2014 10:06
How to add a close button to the Twitter Bootstrap Popover feature
<a
id="children-age-toggler"
data-target-selector="#children-age"
data-placement="bottom"
href="javascript:;"
class="children-age popover-children"
data-title="Children's Age"
></a>
<div id="children-age" class="hidden">
<p>Please select your children's Age</p>
@setola
setola / test.html
Created August 29, 2014 14:20
Test for Banana Tool :)
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Tests for Banana Tool</title>
<link rel='stylesheet'
test='file from external cdn without scheme'
id='reset-css'
href='//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.0/normalize.min.css'
type='text/css'
@setola
setola / Google-Maps-paddings.markdown
Last active August 29, 2015 14:07
A Pen by Emanuele Tessore.
@setola
setola / functions.php
Last active August 29, 2015 14:15
WordPress invert post dates
<?php
$articles = get_posts(array(
'post_type' => MY_CUSTOM_POST_TYPE,
'numberposts' => -1
));
$date = array();
foreach($articles as $art){
$date[] = array($art->post_date_gmt, $art->post_date);
@setola
setola / custom-post-password-template.php
Created February 20, 2015 15:47
WordPress customize post password authentication system
<?php
/*
Template Name: Custom Password
*/
/**
* Checks if the given code has a valid format ex: AB123456789
* @param $code string the code
* @return bool true only if code is valid
<?php
// First we remove all the shortcodes from the post body
add_action('the_content', 'strip_shortcodes');
get_template_part('header');
?>
<div id="main-container" class="container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">