Skip to content

Instantly share code, notes, and snippets.

View jsdecena's full-sized avatar
👑
Focusing

Jeff Decena jsdecena

👑
Focusing
View GitHub Profile
@jsdecena
jsdecena / table.html
Created August 31, 2019 03:02
Dynamic posts in table html
<div class="table-responsive">
<table class="table table-striped table-sm">
<thead>
<tr>
<th>#</th>
<th>Title</th>
<th>Body</th>
</tr>
</thead>
<tbody>
@jsdecena
jsdecena / script.js
Last active August 31, 2019 03:51
LandingPage.vue script
<script>
import SystemInformation from './LandingPage/SystemInformation'
export default {
name: 'landing-page',
components: { SystemInformation },
data () {
return {
posts: []
}
@jsdecena
jsdecena / data.js
Created August 31, 2019 02:59
The data and the created property
export default {
....
data () {
return {
posts: []
}
},
created () {
this.getPosts()
},
@jsdecena
jsdecena / methods.js
Last active August 31, 2019 03:52
Method block
methods: {
open (link) {
this.$electron.shell.openExternal(link)
},
getPosts () {
const posts = JSON.parse(localStorage.getItem('posts'))
this.posts = posts
}
}
@jsdecena
jsdecena / template.html
Last active August 31, 2019 05:17
LandingPage.vue
<template>
<div id="main">
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="#">Electron CMS</a>
<input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
<a class="nav-link" href="#">Sign out</a>
</li>
</ul>
@jsdecena
jsdecena / style.css
Last active August 31, 2019 02:20
Bootstrap 4 Dashboard CSS
<style>
@import url('https://getbootstrap.com/docs/4.0/dist/css/bootstrap.min.css');
body {
font-size: .875rem;
}
.feather {
width: 16px;
@jsdecena
jsdecena / loop.php
Created August 26, 2019 08:06
Form
@foreach($users as $user)
<a href="/view/$user->id">View user</a>
<a href="/edit/$user->id">Edit user</a>
<form action="/delete/$user->id" method="post">
<button type="submit">Delete user</button>
</form>
@endforeach
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class CorsMiddleware
{
/**
@jsdecena
jsdecena / gist:486a0291f6abb7437039962b1a772895
Created July 2, 2019 11:42
Git prune remote and local branches
// Local - (optional, use w care)
git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d
// Origin - (remove merged branch in origin)
git remote prune origin
public function testUpdateBook() {
$book = factory(Book::class)->create();
$data = [
'author' => 'John Doe'
];
$this->put(route('book.update', $book->id), $data)
->assertStatus(200)