This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#User scaffolding | |
php artisan generate:scaffold user --fields="email:string:nullable:unique, password:string:nullable, first_name:string:nullable, last_name:string:nullable, gender:string(16):nullable:default('male'), birthday:date:nullable" | |
#Social accounts | |
php artisan generate:migration create_socials_table --fields="user_id:integer:unsigned, soc_uid:string, provider:string(8), user_id:foreign:references('id'):on('users'):onDelete('cascade')" | |
php artisan generate:model Social | |
#Social wall posts | |
php artisan generate:migration create_social_posts_table --fields="user_id:integer:unsigned:nullable, post_id:string, provider:string(8):default('fb'), user_id:foreign:references('id'):on('users'):onDelete('set null')" | |
php artisan generate:model SocialPost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.Store = DS.Store.extend | |
revision: 1, | |
adapter: DS.RESTAdapter.extend | |
namespace: 'api' | |
App.ApplicationSerializer = DS.RESTSerializer.extend | |
extractMeta: (store, type, payload)-> | |
if payload && payload.pagination | |
store.metaForType type, payload.pagination | |
delete payload.pagination |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.ApplicationRoute = Ember.Route.extend | |
actions: | |
loading: -> | |
NProgress.start() | |
@router.one('didTransition', -> | |
setTimeout (-> NProgress.done()), 50 | |
) | |
true | |
error: -> | |
setTimeout (-> NProgress.done()), 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
To make a route filterable | |
specify @modelName property in your route as in example below | |
App.UsersIndexRoute = Ember.Route.extend Ember.FilterableRouteMixin, | |
modelName: 'user' | |
### | |
Ember.FilterableRouteMixin = Ember.Mixin.create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i "src.mp4" \ | |
-b 2048k -vcodec libvpx -acodec libvorbis -ab 160000 -f webm -g 30 "v.webm" \ | |
-b 3072k -vcodec libtheora -acodec libvorbis -ab 160000 -g 30 "v.ogv" \ | |
-b 2048k -vcodec h264 -acodec libfaac -ab 160000 -g 30 "v.mp4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# helpers | |
# $ = jQuery | |
# See: http://learn.jquery.com/code-organization/deferreds/examples/ | |
# Generic asynchronous cache | |
$.createCache = (requestFunction)-> | |
cache = {}; | |
return (key, callback)-> | |
if ( !cache[key] ) | |
cache[key] = $.Deferred((defer)-> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Animator | |
constructor: (obj)-> | |
@obj = obj | |
@stack = [] | |
console.log this | |
add: (property, to, duration, callback, easing)-> | |
@stack.push { | |
property: property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace RedirectAjax; | |
class RedirectAjax extends \Illuminate\Support\Facades\Redirect { | |
public static function __callStatic($method, $args) { | |
\App::bind('redirect', function($app) | |
{ | |
$redirector = new Redirector($app['url']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="preloader"> | |
<div class="sun"> | |
<div class="o"></div> | |
<div class="w"></div> | |
</div> | |
Loading | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use RecursiveTreeIterator, CachingIterator, RecursiveIterator, RecursiveIteratorIterator; | |
/** | |
* RecursiveTreeIterator that accepts callback for flattening non-string items | |
* | |
* Class RecursiveTreeCallbackIterator | |
*/ | |
class RecursiveTreeCallbackIterator extends RecursiveTreeIterator |
OlderNewer