Skip to content

Instantly share code, notes, and snippets.

View deividaspetraitis's full-sized avatar

Deividas Petraitis deividaspetraitis

View GitHub Profile
@deividaspetraitis
deividaspetraitis / create_laravelmysqlspatial_table.php
Last active October 11, 2017 10:24
Work around for error: `Table::{closure}() must be an instance of Grimzy\LaravelMysqlSpatial\Schema\Blueprint, instance of Illuminate\Database\Schema\Blueprint given, called in ...`
<?php
use Illuminate\Database\Migrations\Migration;
use Grimzy\LaravelMysqlSpatial\Schema\Blueprint;
class CreateTable extends Migration
{
/**
* Run the migrations.
*
@deividaspetraitis
deividaspetraitis / Application.php
Created October 5, 2017 06:03
Custom Request object is overridden by default Illuminate\Http\Request
<?php namespace App;
class Application extends \Laravel\Lumen\Application
{
use Concerns\RoutesRequests; // override with our new trait
}
@deividaspetraitis
deividaspetraitis / anagrams.php
Created February 22, 2017 11:52
Returns TRUE if the two input strings form anagrams of each other otherwise FALSE
<?php
$string1 = strtolower(preg_replace('/\s+/', '', "AstroNomers")); // Prepare string
$string2 = strtolower(preg_replace('/\s+/', '', "no more stars")); // Prepare string
$bool = isAnagram ( $string1, $string2 );
/**
* Returns TRUE if the two input strings form anagrams of each other otherwise FALSE.
* Also return FALSE in case of invalid inputs.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gcc autoconf bison flex libtool make libboost-all-dev libcurl4-openssl-dev curl libevent-dev uuid-dev
cd ~
wget https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz
@deividaspetraitis
deividaspetraitis / pom.xml
Created August 9, 2015 08:19
M101J pom.xml spark dependencies
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mongodb</groupId>
<artifactId>M101J</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>M101J</name>