Skip to content

Instantly share code, notes, and snippets.

Avatar

Ivan Dorić ivandoric

View GitHub Profile
View momoo.jsx
import { PureComponent, createRef, cloneElement } from 'react'
import Link from 'next/link'
import injectSheet, { withTheme } from 'react-jss'
import PropTypes from 'prop-types'
import Grid from 'components/Grid'
import LogoFull from 'static/svg/logo-full.svg'
import HamburgerFull from 'static/icons/hamburger-full.svg'
import Close from 'static/icons/close.svg'
@ivandoric
ivandoric / wl-api.php
Last active Aug 26, 2022
WordPress Rest API Custom Endpoints Video Tutorials Notes - Check out the videos: https://www.youtube.com/watch?v=C2twS9ArdCI and https://www.youtube.com/watch?v=76sJL9fd12Y
View wl-api.php
<?php
/**
* Plugin Name: Custom API
* Plugin URI: http://chrushingit.com
* Description: Crushing it!
* Version: 1.0
* Author: Art Vandelay
* Author URI: http://watch-learn.com
*/
@ivandoric
ivandoric / settings.json
Created Apr 28, 2019
Sublime Text 3 - config
View settings.json
{
"always_show_minimap_viewport": true,
"atomic_save": false,
"auto_indent": true,
"binary_file_patterns":
[
"**/images/*",
".sass-cache/*",
"PatternLab-UDG-Draft/*",
"PatternLab-new/public/*",
@ivandoric
ivandoric / gulpfile.js
Created Apr 28, 2019
PatternLab setup with Scss support
View gulpfile.js
/** ****************************************************
* PATTERN LAB NODE
* EDITION-NODE-GULP
* The gulp wrapper around patternlab-node core, providing tasks to interact with the core library and move supporting frontend assets.
***************************************************** */
let gulp = require('gulp'),
path = require('path'),
browserSync = require('browser-sync').create(),
sass = require('gulp-sass'),
argv = require('minimist')(process.argv.slice(2)),
View html
<!-- zelim -->
<section class="zelim-wrap">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-7">
<h2 class="futuraBook title">Najpopularni mobiteli na pretplatu</h2>
</div>
<div class="col-xs-12 col-sm-5 text-right hidden-xs">
<a href="#" class="btn btn-default btn-lg text-upper btn-svi-uredjaji">Svi mobiteli</a>
@ivandoric
ivandoric / html
Created Apr 21, 2018
Portlet code example.
View html
<div class="row no-pad"> <div class="col-xs-12"> <div class="zelim-slider-wrap"> <div class="zelim-slider owl-carousel owl-theme" data-zelim-slider-id="_deviceoffer_WAR_vipnetdeviceofferr_" style="opacity: 1; display: block;"> <div class="owl-wrapper-outer"><div class="owl-wrapper" style="width: 5900px; left: 0px; display: block; transition: all 0ms ease; transform: translate3d(0px, 0px, 0px);"><div class="owl-item" style="width: 295px;"><script type="text/javascript">/*<![CDATA[*/var productViewObjects_deviceoffer_WAR_vipnetdeviceofferr_=[];var productsClickObjects_deviceoffer_WAR_vipnetdeviceofferr_=[];var productList_deviceoffer_WAR_vipnetdeviceofferr_="Najpopularniji mobiteli na pretplatu";/*]]>*/</script></div><div class="owl-item" style="width: 295px;"><div class="item" data-index="0"> <div class="device-box"> <a href="/webshop/pretplata/mobiteli-na-pretplatu/huawei-p20-lite-crni/13100" data-product-click-index="0"> <figure><img src="http://static.vip.hr/hwdb/images/uploaded/VPR_picture_big/2458955_6675
@ivandoric
ivandoric / gist:05afb0e2f40804473907d14a9ee6f50b
Created May 20, 2016
Laravel: remove file with Dropzone
View gist:05afb0e2f40804473907d14a9ee6f50b
removedfile: function(file) {
var name = file.name;
var token = $('[name=_token').val();
var dir = $('[name=dir]').val();
console.log(file.name);
$.ajax({
type: 'POST',
headers: {'X-CSRF-Token': token},
url: '/delete-gallery-image',
data: {id: name, dir: dir },
@ivandoric
ivandoric / gist:a714e4ae85f9a117387e
Created Jan 4, 2016
Laravel: Do this after deploy
View gist:a714e4ae85f9a117387e
$ php composer install
$ php composer dumpautoload -o
$ php artisan config:cache
$ php artisan route:cache
View gist:a152fa03e17e794c59e2
// Starting model factory
$ php artisan tinker
>>> factory('App\ModelName', 10)->create();
@ivandoric
ivandoric / date-time.rb
Created Nov 12, 2015
Ruby: Date and time formating
View date-time.rb
Date (Year, Month, Day):
%Y - Year with century (can be negative, 4 digits at least)
-0001, 0000, 1995, 2009, 14292, etc.
%C - year / 100 (round down. 20 in 2009)
%y - year % 100 (00..99)
%m - Month of the year, zero-padded (01..12)
%_m blank-padded ( 1..12)
%-m no-padded (1..12)
%B - The full month name (``January'')