Skip to content

Instantly share code, notes, and snippets.

View mvrkljan's full-sized avatar

Martin Vrkljan mvrkljan

  • Samobor, Croatia
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mvrkljan on github.
  • I am mvrkljan (https://keybase.io/mvrkljan) on keybase.
  • I have a public key ASBaFZGfoWqBE_tZ8y13A6QZhF91Sv2Ux29c8K8H0WOGSwo

To claim this, I am signing this object:

@mvrkljan
mvrkljan / FormRequest.php
Created January 28, 2016 12:25
Custom validation logic in Laravel FormRequests
protected function getValidatorInstance()
{
$validator = parent::getValidatorInstance();
$validator->after(function($validator) {
// Place custom logic here, add errors using $validator->errors()
$validator->errors()->add('field', 'message');
});
div.some-container {
@extend %grid-row;
div.some-element {
@extend %grid-one-whole;
@extend %grid-medium-up-one-third;
@extend %grid-large-up-one-quarter;
}
}
@mvrkljan
mvrkljan / twitterFeed.php
Last active December 23, 2015 19:19
Twitter Feed Snippet for PHP (GET) using https://github.com/J7mbo/twitter-api-php
require (Config::read('sitePath') . 'app/vendors/TwitterAPIExchange/TwitterAPIExchange.php');
$twitter = new TwitterAPIExchange(
array(
'oauth_access_token' => "ACCESS_TOKEN",
'oauth_access_token_secret' => "ACCESS_TOKEN_SECRET",
'consumer_key' => "CONSUMER_KEY",
'consumer_secret' => "CONSUMER_SECRET"
)
);
@mvrkljan
mvrkljan / extendGmapBounds.js
Created September 18, 2013 10:24
Handle extended bounds for single marker in Google Maps.
var bounds = new google.maps.LatLngBounds(),
// Difference in lat and lng values for which bounds are expanded
delta = 0.001;
for (i = 0; i < markers.length; i++) {
bounds.extend(markers[i].position);
}
if (bounds.getNorthEast().equals(bounds.getSouthWest())) {
bounds.extend(