Skip to content

Instantly share code, notes, and snippets.

Ivan Dorić ivandoric

Block or report user

Report or block ivandoric

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ivandoric
ivandoric / wl-api.php
Created May 5, 2019
Creating WordPress Rest API Custom Endpoints
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 / gulpfile.js
Last active Jul 14, 2019
Adding Svelte To Your Website Using Gulp and Webpack
View gulpfile.js
// This is the code used in video "How To Add Svelte To Your Site?"
// Check out the video here: https://www.youtube.com/watch?v=ZL7mKFQHSAY
const gulp = require('gulp')
const sass = require('gulp-sass')
const browsersync = require('browser-sync').create()
const webpack = require('webpack')
const webpackStream = require('webpack-stream')
@ivandoric
ivandoric / steam.md
Created Jun 19, 2019 — forked from graffic/steam.md
Downloading steam games from another computer/faster line
View steam.md

Framing the issue

With almost no bandwith at home, I needed a way to download DOOM that didn't involve blocking the home internet line for two days.

Approach

Using steamcmd you can use any computer to download steam games.

Downloading

  1. Install it
  2. Open it and loging with your username and password: login username password
@ivandoric
ivandoric / list.phtml
Last active Jun 13, 2019
magento: Check if product is new in product listing
View list.phtml
<?php
$newFromDate = Mage::getModel('catalog/product')->load($_product->getID())->getNewsFromDate();
$newToDate = Mage::getModel('catalog/product')->load($_product->getID())->getNewsToDate();
$now = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
if(($newFromDate < $now && $newFromDate != NULL) && ($newToDate > $now || $newToDate == "")){
echo "New Product";
}
?>
View momo.js
/* eslint-disable quote-props */
const style = theme => ({
mainNav: {
marginLeft: '-80px',
'& .menu-wrap': {
position: 'relative',
zIndex: 9
},
'& .logo': {
marginLeft: '20px'
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 / gist:e4e46294c4d35eac0ec8
Created Jun 5, 2014
wordpress: create custom reset password page
View gist:e4e46294c4d35eac0ec8
<?php //Add all of this tu custom page template ?>
<?php
global $wpdb;
$error = '';
$success = '';
// check if we're in reset form
if( isset( $_POST['action'] ) && 'reset' == $_POST['action'] )
{
@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)),
@ivandoric
ivandoric / gist:11215045
Created Apr 23, 2014
shell: SCP cheat sheet
View gist:11215045
Copy the file "foobar.txt" from a remote host to the local host
$ scp your_username@remotehost.edu:foobar.txt /some/local/directory
Copy the file "foobar.txt" from the local host to a remote host
$ scp foobar.txt your_username@remotehost.edu:/some/remote/directory
Copy the directory "foo" from the local host to a remote host's directory "bar"
$ scp -r foo your_username@remotehost.edu:/some/remote/directory/bar
Copy the file "foobar.txt" from remote host "rh1.edu" to remote host "rh2.edu"
You can’t perform that action at this time.