gitflow | git |
---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
This file contains hidden or 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
let mix = require('laravel-mix'); | |
let httpRequest = require('request') | |
let criticalCSS = require('critical') | |
//Run your asset compilation commands... | |
//Then we will generate critical css... | |
mix.then(()=>{ | |
console.log("Build Post-Processing...") | |
const criticalRoutes = [ |
This file contains hidden or 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
export const responsiveText = (selector) => { | |
const rtWrappers = document.querySelectorAll(selector) | |
rtWrappers.forEach(wrapper => { | |
const width = wrapper.offsetWidth, | |
height = wrapper.offsetHeight, | |
text = wrapper.innerHTML | |
let textLength = typeof text === "string" ? text.trim().replace(" ", "").length : 0 |
This file contains hidden or 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
desc "Create about and revision files." | |
task :rev_deployment, :roles => [:app, :web] do | |
require 'grit' | |
require 'chronic' | |
# include Grit | |
work_dir = File.join(File.dirname(__FILE__), '../../') | |
g = Grit::Repo.new(work_dir) | |
since = Chronic.parse('last week friday') | |
msg = "\n" | |
rev_file = File.join(File.dirname(__FILE__), '../../','tmp/revision.txt') |
This file contains hidden or 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
function _alphaOnly($value) | |
{ | |
return preg_replace('/[^[:alnum:]\-\.]/u', '', $value); | |
} | |
/** | |
* @param $number | |
* | |
* @return string | |
*/ |
This file contains hidden or 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 | |
class UserController | |
{ | |
public function lists() | |
{ | |
// Create a fractal instance | |
$fractal = new \League\Fractal\Manager(); | |
// to enable links support, we need to set a baseUrl on serializer |
This file contains hidden or 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 | |
class UserController | |
{ | |
/** | |
* @SWG\Post(path="/user", | |
* tags={"user"}, | |
* summary="Create user", | |
* description="This can only be done by the logged in user.", |
This file contains hidden or 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
... | |
<script> | |
if ("serviceWorker" in navigator) { | |
navigator.serviceWorker.register("/service-worker.js").then((registration) => { | |
console.log("Service worker registered successfully with scope: ", registration.scope) | |
}).catch((error) => { | |
console.error("Service worker registration failed.", error) | |
}) | |
} else { |
This file contains hidden or 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
"use strict" | |
let cacheVersion = 3 | |
const offlineUrl = "offline-page.html" | |
self.addEventListener("install", event => { | |
event.waitUntil(caches.open("offline-cache-" + cacheVersion).then(cache => cache.addAll([ | |
"/index.html", | |
offlineUrl, | |
// other more url of files, css, js etc. |