Skip to content

Instantly share code, notes, and snippets.

View itumulak's full-sized avatar
🎯
Focusing

Ian Tumulak itumulak

🎯
Focusing
  • Davao City, Philippines
View GitHub Profile
@itumulak
itumulak / .gitignore
Last active June 3, 2016 10:20 — forked from salcode/.gitignore
Day to day WordPress .gitignore. It ignores almost all files by default.
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20160309
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/e5b4d7bfa401d6eecfe2771eb1875a5e/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
@itumulak
itumulak / anagram.php
Last active October 7, 2017 18:20
Anagram Puzzle. Oct. 7 DevCon Code Challenge.
<?php
$dictionary = [
'epty',
'pety',
'yetpa',
'epyt'
];
$targetted_word = 'type';
@itumulak
itumulak / reset.scss
Created October 25, 2017 13:18 — forked from HamptonMakes/reset.scss
Reset SCSS
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
@itumulak
itumulak / helper.php
Last active November 2, 2017 07:51
Create an excerpt from the content if nothing is set
/**
* Allows to switch between excerpt and content.
* If excerpt is not set we will use content but limit the words.
* Ideally use for custom queries.
*
* @param string $content
* @param string $excerpt
* @param int $word_limit
* @param string $more
* @return string $trimmed_content
// Best added in :before or :after
@mixin img_overlay($width, $height, $url : '../img/video-player.png' ) {
background-image: url($url);
max-width: #{$width}px;
max-height: #{$height}px;
content: ' ';
display: block;
width: 100%;
position: absolute;
height: 100%;
$flex-justify: (
'start' : 'flex-start',
'end' : 'flex-end',
'center' : 'center',
'between' : 'space-between',
'around' : 'space-around'
);
$flex-align: (
'start' : 'flex-start',
$breakpoints: (
"phone": 400px,
"phone-wide": 480px,
"phablet": 560px,
"tablet-small": 640px,
"tablet": 768px,
"tablet-wide": 1024px,
"desktop": 1248px,
"desktop-wide": 1440px
);
@itumulak
itumulak / wp-image-handling.php
Last active September 24, 2018 16:41
Wordpress Image Handling
<?php
/**
* Wordpress Image Handling.
*
* @param array $file $_FILE. File Path Request.
* @return array $status Status
*/
function imageHandling( $file )
{
$imageArray = wp_handle_upload( $file, ['test_form' => false] );
@itumulak
itumulak / docker-compose.yml
Created May 22, 2019 20:23
Docker Compose for itumulak/wordpress-cli
version: '2'
services:
db:
image: mysql:5.7
volumes:
- ./db:/docker-entrypoint-initdb.d
- ./db_data:/var/lib/mysql
restart: always
environment:
@itumulak
itumulak / docker-compose.yml
Last active July 3, 2019 21:05
WordPress + Elasticsearch Stack
version: '2'
services:
db:
image: mysql:5.7
volumes:
- ./db:/docker-entrypoint-initdb.d
- ./db_data:/var/lib/mysql
restart: always
environment: