- 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 (https://github.com/airbnb/react-native-maps, https://github.com/evollu/react-native-fcm) - DO NOT USE COCOAPODS
- Learn how to use fetch to get data from your backend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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'); | |
resultsList.perfectScrollbar({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM wp_posts WHERE | |
ID IN | |
( | |
SELECT element_id FROM wp_icl_translations WHERE element_type = 'post_attachment' AND language_code != 'en' | |
) | |
DELETE FROM wp_postmeta WHERE | |
meta_key= '_thumbnail_id' AND meta_value IN | |
( | |
SELECT element_id FROM wp_icl_translations WHERE element_type = 'post_attachment' AND language_code != 'en' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cc_mime_types($mimes) { | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} | |
add_filter('upload_mimes', 'cc_mime_types'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 https://github.com/litehelpers/Cordova-sqlite-storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('input:text, textarea').each(function(){ | |
var $this = $(this); | |
$this.data('placeholder', $this.attr('placeholder')) | |
.focus(function(){$this.removeAttr('placeholder');}) | |
.blur(function(){$this.attr('placeholder', $this.data('placeholder')); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Directive, ElementRef} from 'angular2/core'; | |
import {Subject} from "rxjs/Subject"; | |
import {Content, IonicApp} from "ionic-angular/index"; | |
/* | |
* WIP mashup of | |
* http://www.joshmorony.com/how-to-create-a-directive-in-ionic-2-parallax-header/ | |
* and ionic2 infinite scroll techniques to access properties | |
* and http://codepen.io/kaemak/pen/mHyKa | |
* to get desired behaviour on scroll up/down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; | |
@Injectable() | |
export class AuthHttp { | |
process: EventEmitter<any> = new EventEmitter<any>(); |
NewerOlder