Skip to content

Instantly share code, notes, and snippets.

View factoryhr's full-sized avatar

Factory.dev factoryhr

View GitHub Profile
pod 'CustomUISwitch', :path => "[PATH_TO_YOUR_LOCAL_FOLDER]"
pod init
open -a Xcode Podfile
Pod::Spec.new do |spec|
#1
spec.name = "CustomUISwitch"
spec.version = "0.0.1"
spec.summary = "Customizable switch."
spec.description = <<-DESC
Switch is a pod that contains code for creating customizable UI Switch element.
DESC
spec.homepage = "http://www.factory.hr"
#2
pod spec create CustomUISwitch
Schema::create('movies', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->text('description');
$table->integer('year');
$table->float('rating');
$table->string('image')->nullable();
$table->timestamps();
});
public function search(Request $request)
{
if($request->has('text') && $request->input('text')) {
// Search for given text and return data
$data = $this->searchMovies($request->input('text'));
$moviesArray = [];
// If there are any movies that match given search text "hits" fill their id's in array
if($data['hits']['total'] > 0) {
// Fill array with movie data
$data = [
'body' => [
'id' => $movie->id,
'name' => $movie->name,
'year' => $movie->year,
'description' => $movie->description,
'rating' => $movie->rating,
'actors' => implode(',', $movie->movie_actors->pluck('name')->toArray())
],
$movies = Movie::all();
foreach ($movies as $movie) {
// Add index and type data to array
// Movie::ELASTIC_INDEX => movies
// Movie::ELASTIC_TYPE => movie
$data['body'][] = [
'index' => [
'_index' => Movie::ELASTIC_INDEX,
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:overScrollMode="never">
<RelativeLayout
android:id="@+id/rlProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:overScrollMode="never">
<RelativeLayout
android:id="@+id/rlProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content">