Skip to content

Instantly share code, notes, and snippets.

View brocard's full-sized avatar
🏠
Working from home...

Yusniel Brocard brocard

🏠
Working from home...
View GitHub Profile
@brocard
brocard / example.js
Created September 11, 2013 22:28
Welcome to your first Gist! Gists are simple code reminders. Whenever you come across a piece of code you think might be useful later on, save it as a Gist. With GistBox, you can also tag the Gist with a label. This is especially useful for keeping them organized by language, project or purpose. For more info about GistBox, visit: http://www.gi…
// log an object to the browser console
console.log({ text: "foobar" });
@brocard
brocard / custom.js
Created September 11, 2013 22:33
Modal Popup
/* Custom Modal Popup */
function show_popup(){
$('[data-toggle="modal"]').click(function(e) {
e.preventDefault();
var data_target=$(this).attr('data-target');
if (data_target=="#") {
data_target="#modal"+parseInt(Math.random()*1000);
}
var url = $(this).attr('href');
sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
@brocard
brocard / Laravel PHP7 LEMP AWS.md
Last active March 7, 2018 17:39 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
(function ($) {
'use strict';
var pr1 = pr1 || {};
pr1 = {
init: function () {
}
};
@brocard
brocard / GoogleDriveServiceProvider.php
Created May 1, 2018 05:20 — forked from sergomet/GoogleDriveServiceProvider.php
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class GoogleDriveServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
@brocard
brocard / webpack-for-node-modules.js
Created October 9, 2018 18:24 — forked from mxstbr/webpack-for-node-modules.js
How to use webpack to compile node modules
/* eslint-disable no-var */
var path = require('path');
var autoprefixer = require('autoprefixer');
const MATCH_ALL_NON_RELATIVE_IMPORTS = /^\w.*$/i;
module.exports = [{
output: {
filename: '[name].js',
library: 'atrium-react-plugin-beta',
@brocard
brocard / troubleshooting.md
Created March 19, 2019 03:08 — forked from adamwathan/troubleshooting.md
Troubleshooting Valet on macOS Sierra

Troubleshooting Valet on Sierra

Common Problems

Problem: I just see "It works!"

Apache is running on port 80 and interfering with Valet.

  1. Stop Apache: sudo /usr/sbin/apachectl stop
  2. Restart Valet: valet restart
@brocard
brocard / index.html
Created June 13, 2019 14:20
Table with fixed header, footer and left column using position:sticky
<h1 class="intro">Table with fluid height and width fixed header, footer and first column using position:sticky </h1>
<p class="intro">This example uses position:sticky on the th elements in the thead, tfoot and left column to achieve the fixed effect. Browsers that don't support position:sticky will just get a normal table so no harm done. Resize browser smaller to see fixed first column.</p>
<div id="table-scroll" class="table-scroll">
<table id="main-table" class="main-table">
<thead>
<tr>
<th scope="col">Header 1</th>
<th scope="col">Header 2</th>
<th scope="col">Header 3 with longer content</th>
<th scope="col">Header 4 text</th>
@brocard
brocard / js
Created June 28, 2020 18:17
chunk array javascript
chunkArray(arr, n) {
return arr.length ? [arr.slice(0, n), ...this.chunkArray(arr.slice(n), n)] : [];
},