Skip to content

Instantly share code, notes, and snippets.

View alex-oliveira's full-sized avatar

Alex Oliveira alex-oliveira

View GitHub Profile
@alex-oliveira
alex-oliveira / install
Last active August 14, 2020 19:04
slax
apt update
fdisk /dev/sda
p
n
p
-
-
-
@alex-oliveira
alex-oliveira / vagrant destroy
Created May 22, 2020 23:18
docker does not work within the homestead.
homestead: Are you sure you want to destroy the 'homestead' VM? [y/N] y
==> homestead: Forcing shutdown of VM...
==> homestead: Destroying VM and associated drives...
@alex-oliveira
alex-oliveira / delete-after-download.php
Last active June 6, 2018 19:09
delete after download
<?php
$folder = 'C:\Users\alexdeoliveira\Downloads\selemium';
$files = [];
$dir = opendir($folder);
while ($filename = readdir($dir)) {
if (!in_array($filename, ['.', '..'])) {
$files[] = $filename;
@alex-oliveira
alex-oliveira / APP VERSION.md
Last active May 10, 2018 18:19
APP VERSION

APP VERSION

Códigos para forçar o frontend a se atualizar automáticamente quando uma nova versão está disponível.

Prerequisitos:

  • Frontend feito com AngularJS e backend feito com Laravel
  • Frontend e backend que compartilham o mesmo nome de versão
  • Procedimento externo que atualize o nome da versão atual

LARAVEL API CONFIGS

@alex-oliveira
alex-oliveira / database.js
Last active December 16, 2017 13:08
DATABASE JS TOOLS
'use strict';
angular.module('shared')
.factory('$database', ['$q', '$migrations', 'DEBUG_DB',
function ($q, $migrations, DEBUG_DB) {
var Factory = function (config) {
this.data = {};
this.data.name = 'db';
this.data.description = Factory.name;

INDEX.HTML

<script src="http://192.168.2.26:8088/target/target-script-min.js#anonymous"></script>

LOCAL PROMPT

weinre --httpPort 8088 --boundHost -all-
@alex-oliveira
alex-oliveira / vuejs.md
Last active May 16, 2017 20:26
Vue.JS 2

Init of project (Standalon + ESLint + Airbnb)

$ vue init webpack my-project

Init of node

$ cd my-project

@alex-oliveira
alex-oliveira / angular.md
Last active April 20, 2017 17:40
Notes about Angular

Create a project with preprocessor of css

ng new my-project --style=sass

ng new my-project --style=less

``

@alex-oliveira
alex-oliveira / homestead.md
Last active April 20, 2017 19:22
Sharing Virtual Localhost

Starting Homestead

$ vagrant up

Sharing Main Homestead Host

$ vagrant share

$ sudo pico /etc/mysql/mysql.cnf
[mysqld]
federated
$ service mysql restart