Skip to content

Instantly share code, notes, and snippets.

@zofe
zofe / mysql-backup-tables.sh
Created May 13, 2016 16:24 — forked from tacone/mysql-backup-tables.sh
Backup all mysql tables
#!/bin/sh
#
# Adapted from: https://www.howtoforge.com/shell-script-to-back-up-all-mysql-databases-each-table-in-an-individual-file-and-upload-to-remote-ftp
#
# System + MySQL backup script
# Copyright (c) 2008 Marchost
# This script is licensed under GNU GPL version 2.0 or above
# ---------------------------------------------------------------------
#########################
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Requests;
use App\Article;
use App\Tag;
use App\Category;
use Zofe\Rapyd\DataForm\Field\Checkboxgroup;
class AdminArticlesController extends AdminController
<?php
....
public function getLatlon()
{
$province = Provincia::all();
foreach($province as $p)
{
/** @var \App\Provincia $p */
<object width="100%" height="100%" id="fp_05257577_api" name="fp_05257577_api" data="/site-assets/flowplayer/flowplayer-3.2.16.swf" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="quality" value="high"><param name="bgcolor" value="#000000"><param name="flashvars" value="config={&quot;clip&quot;:{&quot;url&quot;:&quot;/uploads/vetrine/00008933/video/sanitaria8.mp4&quot;,&quot;autoPlay&quot;:true},&quot;playerId&quot;:&quot;fp_05257577&quot;,&quot;playlist&quot;:[{&quot;url&quot;:&quot;/uploads/vetrine/00008933/video/sanitaria8.mp4&quot;,&quot;autoPlay&quot;:true}]}"></object>
<?php
namespace App\Services;
use App\Helpers\Inliner;
class Mailer {
public static function send($view, $data, \Closure $callback) {
@zofe
zofe / envoy.php
Last active December 1, 2015 14:24
@servers(['web' => '[email protected]', 'local'=>'localhost'])
<?php
$repo = 'public_html/stage/';
?>
@task('commit', ['on'=>'local'])
git add .
git commit -m "auto"
git push origin master
<?php
$response = \Cache::remember('mia_chiave', env('CACHE_EXPIRE'), function() {
return view('path.vista')->render();
});
return response($response,200);
@zofe
zofe / remote.html
Created October 14, 2015 20:46
remote riot/pjax tag usage: <remote id="login_modal" remote="/users/login/modal"></remote>
<remote>
<div id="pjax-{ opts.id }"></div>
<script>
this.on('mount', function(){
$.get( opts.remote, function( data ) {
$( '#pjax-'+opts.id).html( data );
});
$(document).on('submit', '#pjax-'+opts.id+' form', function(event) {
$.pjax.submit(event, '#pjax-'+opts.id, {push: false, scrollTo: false})
});
@zofe
zofe / PaginateTrait.php
Last active March 19, 2019 20:30
switch laravel 5 pagination from QueryString To URI, using simple traits on models
<?php
/**
* usage in a controlller:
* public function index($page=1) {
* $users = User::paginateUri(5, $page, $links);
* return view('users', compact('users','links'));
* }
* it also support variable number of parameters,
* routes must be defined using {page} or {page?} placeholders
@servers(['web' => '[email protected]', 'local'=>'localhost'])
@task('commit', ['on'=>'local'])
git add .
git commit -m "auto"
git push origin master
@endtask
@task('pull', ['on'=>'web'])
cd /my/remote/host/public_html