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
//Source: https://addyosmani.com/blog/essential-js-namespacing/ | |
var myApp = myApp || {}; | |
myApp.utils = {}; | |
(function() { | |
var val = 5; | |
this.getValue = function() { |
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
/** Tutorial: https://medium.com/@danielalvidrez/adding-es6-promises-to-animate-css-869156ec0cbd **/ | |
$(document).ready(function(){ | |
/** Add Support for Animate.css ES6 Promises **/ | |
$.fn.extend({ | |
animateCss: function (animationName, duration = 1.0, delay = 0) { | |
let _root = $(this); | |
return new Promise((resolve, reject) => { | |
//Animation Event Definitions |
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
$(document).ready(function() { | |
$.fn.select2.defaults.set("theme","bootstrap"); | |
function DDsetState($element, $state){ | |
$element.select2('val', null); | |
if($state === true){ | |
$element.prop("disabled", false); | |
}else{ | |
$element.prop("disabled", true); |
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 | |
$key = '~/.ssh/host_key'; | |
$host = 'user@host.com'; | |
$connection = '-i '.$key.' '.$host; | |
$home = '/home/myroot'; | |
$development = $home.'/webapps/dev'; | |
$releases = $home.'/webapps/deployments/releases'; | |
$storage = $home.'/webapps/deployments/storage'; | |
$current = $home.'/webapps/deployments/current'; | |
$release = $releases.'/ver_'.date('YmdHis'); |
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 | |
$result = []; | |
$task = 'deploy'; | |
$live = true; | |
$process = new \Symfony\Component\Process\Process('/Applications/MAMP/bin/php/php7.1.0/bin/php ~/.composer/vendor/bin/envoy run '. $task); | |
$process->setTimeout(3600); | |
$process->setIdleTimeout(300); | |
$process->setWorkingDirectory(base_path()); | |
$process->run( |
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 | |
class DataModel{ | |
// Hold an instance of the class | |
private static $instance; | |
private $data; | |
private function __construct() { | |
$this->data = array(); | |
} |
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
<!DOCTYPE html> | |
<html lang="{{ config('app.locale') }}"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="robots" content="none" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui"> | |
<meta name="description" content="admin login"> | |
<title>Admin - {{ Voyager::setting("admin.title") }}</title> | |
<link rel="stylesheet" href="{{ voyager_asset('css/app.css') }}"> |
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
public function buildSchema() { | |
$sanJose = Schema::place() | |
->name('First Security Services') | |
->alternateName('Santa Clara County Office') | |
->additionalType('LocalBusiness') | |
->sameAs([ | |
'https://plus.google.com/118059828266473072030/', |
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 | |
//Your Model | |
protected $appends = [ | |
'vue_props', | |
]; | |
//Props Ancestor Attribute | |
public function getVuePropsAttribute(){ | |
$props = (object) array(); |
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 \Illuminate\Support\Collection; | |
Collection::macro('recursive', function () { | |
return $this->map(function ($value) { | |
if (is_array($value)) { | |
return collect($value)->recursive(); | |
} | |
return $value; | |
}); |