Skip to content

Instantly share code, notes, and snippets.

View mayoz's full-sized avatar
🧶
If you don't understand it, you can't change it!

Sercan Cakir mayoz

🧶
If you don't understand it, you can't change it!
View GitHub Profile
[
{
"name":"Adana",
"slug":"adana",
"plate_code":1,
"districts":[
{
"name":"Alada\u011f",
"slug":"aladag"
},
@mayoz
mayoz / any.php
Created April 11, 2014 20:16
Convert single dimensional array with optional parameters (Laravel Form::select)
<?php
// Test data
$categories = array(
array(
'title' => 'Cats',
'value' => 1,
'children' => array(
array(
'title' => 'Leopard',
<?php
App::after(function($request, $response)
{
/**
* HTML Minification
* https://gist.github.com/zmsaunders/5619519
* https://gist.github.com/garagesocial/6059962
*/
if (Config::get('project.minify.html', false) !== false)
<?php
namespace Mayoz\Service\Html;
use Illuminate\Html\FormBuilder as IlluminateFormBuilder;
class FormBuilder extends IlluminateFormBuilder {
/**
* An array containing the currently opened form groups.
/*!
* Grunt
* $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev
*/
module.exports = function(grunt) {
grunt.initConfig({
// Sass
@mayoz
mayoz / basicss.css
Last active August 29, 2015 14:21 — forked from ademilter/basicss.css
/**
* 1. http://www.paulirish.com/2012/box-sizing-border-box-ftw/
* http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/
* http://fatihhayrioglu.com/css3-box-sizing-ozelligi/
*
* 2. http://aestheticallyloyal.com/public/optimize-legibility/
*
* 3. http://maxvoltar.com/archive/-webkit-font-smoothing
*
* 4. http://maximilianhoffmann.com/posts/better-font-rendering-on-osx
@mayoz
mayoz / laravel.js
Last active August 29, 2015 14:23 — forked from JeffreyWay/laravel.js
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {
@mayoz
mayoz / gist:7afad96610abb55d8f53
Created October 8, 2015 19:51 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
<?php
$one->one = 1;
$two->two->one = 21;
$two->two->two = 22;
$three->two->one = 31;
$return_obj = object_merge($one, $two, $three);
// returns:
// Array