Skip to content

Instantly share code, notes, and snippets.

View mladen's full-sized avatar
🌄
Dreaming about mountains and highlands.

Mladen Krivaćević mladen

🌄
Dreaming about mountains and highlands.
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="http://code.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://code.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="https://raw.github.com/gist/2197042/2b90c41b39b7d5b3a851d8f256de2ebd3fe1fb74/leaflet-google.js"></script>
</head>
<body>

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
<?php
// Resizer and Image Manipulation
// Based on: http://forums.laravel.com/viewtopic.php?id=2648
public function post_edit_logo($id)
{
$rules = array(
'image' => 'image',
);
//By David Keegan
//InScopeApps.com
//http://inscopeapps.com/demos/flipbook/
(function($){
$.fn.flipbook = function(options){
options = $.extend({
'start': 0, //start frame
'end': 100, //end frame, must be greater then start
'step': 1, //number of frames to step over while animating

Zero to Database with Laravel

Part 1: Seeding and Viewing

[Laravel][] is a PHP framework that's really a joy to work with -- though I did find the initial learning curve a bit steep.

This tutorial describes a minimum set of steps necessary to pull content from a database and dump it to a url using Laravel's Eloquent ORM. For me, that was the breakthrough moment.

Assuming you've got [Laravel installed][install] and the [database configured][configure], here are the steps needed to get your data from the database into a web browser:

  1. Create a migration
@mladen
mladen / README.md
Created April 17, 2014 10:21
zastite

README is empty

@mladen
mladen / README.md
Created April 17, 2014 11:10
20th Century Deaths Public

README is empty

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
@mladen
mladen / cs.js
Last active August 29, 2015 14:07 — forked from blasten/cs.js
// Build a tree using a compacted object with no pointer for the left/right children
function buildTree(A) {
// Shuffle the array. so we gain a more balance search tree
A.sort(function() { return parseInt(Math.random()*3) - 1; });
var tree = {'0': A[0]}, current = 1;
var inserted, node, treeSize = 1;
// This will take O(N * log N) if we have a balanced tree
// the worst case cost will be O(N^2)
// by d whyte
int[][] result;
float t;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {