This Gist goes over setting up a gulp workflow that will:
- watch for any sass changes, then compiles sass source into css
- watch for any changes in the public directory, and trigger live-reload
- serve static content in
public/
| //BaseModel.php | |
| protected function dateStringToCarbon($date, $format = 'm/d/Y') | |
| { | |
| if(!$date instanceof Carbon) { | |
| $validDate = false; | |
| try { | |
| $date = Carbon::createFromFormat($format, $date); | |
| $validDate = true; | |
| } catch(Exception $e) { } |
| var sort_by = function(field, reverse, primer){ | |
| var key = primer ? | |
| function(x) {return primer(x[field])} : | |
| function(x) {return x[field]}; | |
| reverse = !reverse ? 1 : -1; | |
| return function (a, b) { | |
| return a = key(a), b = key(b), reverse * ((a > b) - (b > a)); |
| <div class="container"> | |
| <div class="row"> | |
| <div class="col-md-6"> | |
| <h3>Tabs</h3> | |
| <!-- tabs --> | |
| <div class="tabbable"> | |
| <ul class="nav nav-tabs"> | |
| <li class="active"><a href="#one" data-toggle="tab">One</a></li> | |
| <li><a href="#two" data-toggle="tab">Two</a></li> | |
| <li><a href="#twee" data-toggle="tab">Twee</a></li> |
| // ---- | |
| // Sass (v4.0.0.alpha.1) | |
| // Compass (vundefined) | |
| // ---- | |
| $settings: ( | |
| maxWidth: 800px, | |
| columns: 12, | |
| margin: 15px, | |
| breakpoints: ( |
| <body> | |
| <header> | |
| <h1>My super duper page</h1> | |
| <!-- Header content --> | |
| </header> | |
| <div role="main"> | |
| <!-- Page content --> | |
| </div> | |
| <aside role="complementary"> | |
| <!-- Secondary content --> |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script src="https://code.jquery.com/jquery-3.1.0.js"></script> | |
| <div id="root"></div> |
| //If a child component wants to communicate back to its parent, it can do so through props, | |
| //most commonly by its parent providing a callback property that the child can call when some event happens: | |
| const ParentComponent = () => { | |
| const letMeKnowAboutSomeThing = () => console.log('something happened!') | |
| return ( | |
| <ChildComponent letMeKnowAboutSomeThing={letMeKnowAboutSomeThing} /> | |
| ) | |
| } |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <input id="filep" type="file" onchange="foo()"> | |
| <div id="result"></div> |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> |