Skip to content

Instantly share code, notes, and snippets.


Wojtczyk awojtczyk

  • Wrocław
View GitHub Profile
awojtczyk / search-form.js
Created Dec 15, 2017
Shopify ajax search
View search-form.js
$(function() {
var currentAjaxRequest = null;
var searchForms = $('form[action="/search"]').css('position', 'relative').each(function() {
var input = $(this).find('input[name="q"]');
input.attr('autocomplete', 'off').bind('keyup change', function() {
var term = $(this).val();
var form = $(this).closest('form');
var searchURL = '/search?type=product&q=*' + term + '*';
var resultsList = $('.search-results');
View search.json.liquid
{% layout none %}
{% capture results %}
{% for item in search.results %}
{% assign product = item %}
"title" : {{ product.title | json }},
"url" : {{ product.url | within: product.collections.last | json }},
"thumbnail": {{ product.featured_image.src | product_img_url: 'thumb' | json }}
{% unless forloop.last %},{% endunless %}
awojtczyk /
Created Mar 8, 2017 — forked from sibelius/
Learning Path React Native


  • Learn how to start a new react native project
  • Run it on ios simulator, on android emulator, on a real iPhone device and on a real Android device, with and without debugging enabled.
  • Learn how to upgrade a react native project
  • Learn how to add a package to the project
  • Learn how to add a package that has a native dependency (, - DO NOT USE COCOAPODS
  • Learn how to use fetch to get data from your backend

Learn Navigation

View SVG upload wordpress 4.7.1.php
// Allow SVG
add_filter( 'wp_check_filetype_and_ext', function($data, $file, $filename, $mimes) {
global $wp_version;
if ( $wp_version !== '4.7.1' ) {
return $data;
$filetype = wp_check_filetype( $filename, $mimes );
View WPML Remove duplicated media
SELECT element_id FROM wp_icl_translations WHERE element_type = 'post_attachment' AND language_code != 'en'
meta_key= '_thumbnail_id' AND meta_value IN
SELECT element_id FROM wp_icl_translations WHERE element_type = 'post_attachment' AND language_code != 'en'
View SVG wordpress.txt
function cc_mime_types($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
add_filter('upload_mimes', 'cc_mime_types');
View Ionic2 Basic start
ionic start MyFirstApp sidemenu --v2
cd MyFirstApp
ionic g page Login
ionic g page Signup
ionic g page List
ionic g provider Data
ionic g provider ChecklistModel
ionic platform add ios
ionic platform add android
ionic plugin add
awojtczyk / Placeholders fix..js
Created Sep 13, 2016
jQuery / javaScript placeholders fix
View Placeholders fix..js
$('input:text, textarea').each(function(){
var $this = $(this);
$'placeholder', $this.attr('placeholder'))
.blur(function(){$this.attr('placeholder', $'placeholder'));
awojtczyk / ElasticHeader.ts
Created Sep 13, 2016
Elastic Header Ionic2
View ElasticHeader.ts
import {Directive, ElementRef} from 'angular2/core';
import {Subject} from "rxjs/Subject";
import {Content, IonicApp} from "ionic-angular/index";
* WIP mashup of
* and ionic2 infinite scroll techniques to access properties
* and
* to get desired behaviour on scroll up/down
View Ionic Http Requests.js
import {Injectable, EventEmitter} from 'angular2/core';
import {Http, Headers, RequestOptions, RequestOptionsArgs, Response, RequestMethod, Request, Connection, ConnectionBackend} from 'angular2/http';
import * as Rx from 'rxjs';
export enum Action { QueryStart, QueryStop };
export class AuthHttp {
process: EventEmitter<any> = new EventEmitter<any>();
You can’t perform that action at this time.