Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Huisman paulhuisman

View GitHub Profile
@paulhuisman
paulhuisman / README.md
Last active Mar 3, 2020
Test voorbeeld van een readme.md
View README.md

Paul Huisman - XT2 - Challenge 1

Wat wil ik bereiken met het dashboard

<< toelichting wat wil ik bereiken met dashboard hier toevoegen>>

Designkeuzes

<< toelichting designkeuzes hier toevoegen>>

Gebruikte techniek

@paulhuisman
paulhuisman / Solarized - Paul.xml
Created Jun 28, 2017
SublimeText Solarized customized theme
View Solarized - Paul.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Solarized - Paul (dark)</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
View EntityFieldQuery.php
<?php
$query = new EntityFieldQuery();
$entities = $query->entityCondition('entity_type', 'node')
->entityCondition('bundle', array('column','blog'))
->propertyCondition('uid', $user->uid)
->propertyCondition('status', 1)
->propertyOrderBy('created', 'DESC')
->range(0, 3)
->execute();
@paulhuisman
paulhuisman / ajax_callback_drupal.php
Last active Dec 15, 2015
Ajax Callbacks in Drupal Forms API
View ajax_callback_drupal.php
<?php
function partners_field_attach_form($entity_type, $entity, &$form, &$form_state, $langcode) {
if ($entity_type != 'field_collection_item' || $entity->field_name != 'field_partner_products') {
return;
}
$form['#after_build'][] = 'partners_products_after_build';
$id = drupal_html_id('partners_field');
$form['#prefix'] = '<div id="'. $id .'">';
View acf-hooks.php
<?php
function acf_field_group_testing($content) {
global $pagenow, $current_screen;
if ($pagenow == 'post-new.php' || $pagenow == 'post.php' && isset($current_screen->post_type)) {
$content = change_order_for_field_group($content, $current_screen->post_type);
}
return $content;
}
View basic_html.html
<!DOCTYPE html>
<html>
<head>
<title>Moo test</title>
</head>
<body>
<h1>Moo</h1>
<p>Lorem ipsum..</p>
</body>
</html>
View php_image_upload.php
<?php
function save($category) {
$packageguide = JRequest::get( 'POST' );
$files = JRequest::get( 'FILES' );
if (isset($files['image_upload']) && !$files['image_upload']['error']) {
$dir = JPATH_ROOT.DS.'media'.DS.'packageguide'.DS.$category;
if(!file_exists($dir)) {
mkdir($dir, 0777, true);
}
move_uploaded_file($files['image_upload']['tmp_name'], $dir.DS.$files['image_upload']['name']);
View cookies_timer.php
<?php
$cookie_value = NULL;
if (!isset($_COOKIE['overlay_display'])) {
$cookie_value = TRUE;
setcookie("overlay_display", $cookie_value, time()+31536000); // Expire in one year
}
else {
$cookie_value = intval($_COOKIE['overlay_display'])+1;
setcookie("overlay_display", $cookie_value, time()+31536000);
View modulo_end.php
<div class="block_content">
<?php $c = 0; foreach ($dossiers as $k => $dossier):
if ($c % 4 == 0) print '<div class="clearfix">';?>
<div class="dossier <?php if ($k % 4 == 3) print 'last'; ?>">
<?php if (!empty($dossier->article_image_filepath)): ?>
<a href="<?php print url('node/'.$dossier->nid); ?>"><?php print theme('imagecache', 'op_list', $dossier->article_image_filepath, '', '', array('class' => 'dossier_img')); ?></a>
<?php endif; ?>
<h4><a href="<?php print url('node/'.$dossier->nid); ?>"><?php print $dossier->title; ?></a></h4>
</div>
<?php if ($c % 4 == 3 || $count == (count($dossiers))) print '</div>';
View gist:304ab83fc385e5ce861d
// get list of all indexes
curl 127.0.0.1:9200/_aliases?pretty=1
// get count of all items in index
curl 127.0.0.1:9200/_search?search_type=count