Skip to content

Instantly share code, notes, and snippets.

View papplo's full-sized avatar
💭
Working from 127.0.0.1

Pablo Anttila papplo

💭
Working from 127.0.0.1
View GitHub Profile
@papplo
papplo / convert-array.js
Created May 1, 2018 07:24 — forked from hengkiardo/convert-array.js
Convert simple array into two-dimensional array(matrix) in javascript
function listToMatrix(list, elementsPerSubArray) {
var matrix = [], i, k;
for (i = 0, k = -1; i < list.length; i++) {
if (i % elementsPerSubArray === 0) {
k++;
matrix[k] = [];
}
matrix[k].push(list[i]);
}
return matrix;
@papplo
papplo / Advanced JS
Last active September 10, 2024 12:23
# Advanced JS | Summary
The purpose of this sprint is to learn:
- Types, values and properties
- Function expressions vs function declarations
- Hoisting
- Closures
- Strict mode
- Context
@papplo
papplo / vanilla-js-cheatsheet.md
Created April 23, 2018 11:47 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
<?php
function optimize_heartbeat_settings( $settings ) {
// Experiment with these two settings below
$settings['autostart'] = false; // default is true
$settings['interval'] = 60; // 15 sec by default
return $settings;
}
add_filter( 'heartbeat_settings', 'optimize_heartbeat_settings' );
@papplo
papplo / CssPopup.html
Last active April 7, 2016 16:26
Css Popup Sans Jscript
<!-- Call css apart -->
<style type="text/css">
body {
color: #333333;
font-family: 'Helvetica', arial;
height:1500px;
}
.wrap {
padding: 40px;
text-align: center;
@papplo
papplo / Gmaps with multiple markers and info box
Created April 7, 2016 16:23
Gmaps with multiple markers and info box
<script type="text/javascript">
function initialized() {
var map;
var bounds = new google.maps.LatLngBounds();
var mapOptions = {
mapTypeId: 'roadmap'
};
// Display a map on the page with div id show_map_div
<?php
/*
* Creating a function to create our CPT LENEROS
*
*/
function create_posttype_leneros() {
register_post_type( 'leneros',
// CPT Options