Skip to content

Instantly share code, notes, and snippets.

View Fuhrmann's full-sized avatar
:octocat:
here we go

Ricardo Fuhrmann Fuhrmann

:octocat:
here we go
View GitHub Profile
@dyon
dyon / laravel-codeception.md
Last active December 22, 2015 14:48
Laravel 4 code changes to integrate Codeception.

Laravel 4 and Codeception

  • Install Codeception via Composer.
    composer require "codeception/codeception:@stable"
  • Create the bootstrap in the app directory.
    codecept bootstrap app
  • Set the PhpBrowser url config in app/tests/acceptance.suite.yml.
  • Move the codeception.yml file to the root directory.
    mv app/codeception.yml codeception.yml
  • Adjust the paths in codeception.yml to reference app/tests rather than tests.
  • Move TestCase.php to the unit tests directory.
@filipbech
filipbech / custom.google.maps.markers.js
Last active December 19, 2017 13:11
Custom markers (div-element) on google maps
Usage:
var myLatLng = new google.maps.LatLng(point.lat, point.lng);
var myMarker = new CustomMarker(myLatLng,map);
Implementation (mostly from googles example):
function CustomMarker(latlng, map) {
this.latlng_ = latlng;
@lavary
lavary / bootstrap-navbar.md
Last active June 17, 2018 19:10
Making multiple menus in a Bootstrap navbar

#Laravel Menu: Bootstrap Navbar

It is possible to create multiple menu instances in a single navbar. I'm going to use Bootstrap default navbar for this demonstration:

First of all we create our menu objects in app/routes.php or app/start/global.php or any other place you desire as long as it is auto loaded when a request hits your application.

routes.php

php
@oanhnn
oanhnn / test.php
Created November 4, 2014 08:44
test performance of array_diff on PHP
<?php
function my_array_diff($a, $b)
{
$map = $out = array();
foreach ($a as $val)
$map[$val] = 1;
foreach ($b as $val)
if (isset($map[$val]))
$map[$val] = 0;
@chrismllr
chrismllr / withNavigationHandlers.js
Created October 30, 2017 20:01
react-native-navigation: navigation handler HOC
/* Usage
const navigationHandlers = [
{
predicate: props => props.currentUser.isAuthenticated === false,
handler: navigator => {
navigator.resetTo({
screen: LOGIN_SCREEN,
animationType: 'fade'
});
}
@smithaaron
smithaaron / ClickToSelectEditText.java
Last active January 2, 2019 18:37 — forked from rodrigohenriques/ClickToSelectEditText.java
Used to make your EditText a better option than Spinners
public class ClickToSelectEditText <T> extends AppCompatEditText {
CharSequence mHint;
OnItemSelectedListener<T> onItemSelectedListener;
ListAdapter mSpinnerAdapter;
public ClickToSelectEditText(Context context) {
super(context);
@kapv89
kapv89 / query-logger.php
Last active January 8, 2019 15:21
Log Queries in L4
<?php
Event::listen('illuminate.query', function($query, $bindings, $time) {
static $count;
if(App::make('env') === 'local')
{
$logFile = __DIR__.'/../storage/logs/queries';
ob_start();
var_dump($bindings, $query);
$str = ob_get_clean();
if($count === null)
@RTLer
RTLer / app.js
Last active March 25, 2019 01:59
vueJs flash message component (alert)
Vue.component('child', {
ready(){
// send flash message
this.$root.$broadcast('flashMessage',{
text: 'Better check yourself, you\'re not looking too good.',
type: 'warning',//optional
important: false,//optional
timeout: 5000//optional
});
@x-Code-x
x-Code-x / readme_install_node
Created April 30, 2012 20:52
Install npm node.js on Debian Squeeze / Wheezy / Linux Mint Debian Edition
#Quick cp from http://sekati.com/etc/install-nodejs-on-debian-squeeze
#
#Needed to install TileMill from MapBox
#
#Installs node.js which has npm bundled
#
#Build Dependencies
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev
@m4grio
m4grio / Blueprint.php
Last active June 14, 2019 06:45
Extending Laravel 5 Blueprint for MySqlConnection
<?php
namespace App\Database\Schema;
use Illuminate\Database\Schema\Blueprint as ParentBlueprint;
use Illuminate\Support\Facades\DB;
/**
* Class Blueprint
*