Skip to content

Instantly share code, notes, and snippets.

View samuelloza's full-sized avatar
🏠
Working from home

Samuel Loza samuelloza

🏠
Working from home
View GitHub Profile
Verificar si todo esta en orden
http://www.mail-tester.com/web-vUjIFq
configurar postfix + opendkim
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-dkim-with-postfix-on-debian-wheezy
En el tutorial explica mal la parte de DNS
1.- Crear registro A -> mail
2.- Crear Mx 0 -> mail.example.com
3.- Crear TXT @ -> "v=spf1 mx ip4:...."
4.- Crear TXT mail._domainkey ->"v=DKIM1; g=*; k=rsa; ...."
@samuelloza
samuelloza / Js
Last active July 30, 2017 21:50
JavaScript HElps
Interesting Jquery
____________________________________________________________________________________
//Añadir elementos a un select
$('#mySelect')
.append($("<option></option>")
.attr("value",key)
.text(value));
_____________________________________________________________________________________
selection tag select for select value
example : $('#species select option[value="' + + '"]').prop('selected',true);
@extends('adminv.master')
@section('title_page') Crear Usuarios @stop
@section('description_page') Gestion de usuario @stop
@section('content')
<form action="{{route('admin.usuario.store')}}" method="post" enctype="multipart/form-data" class="form-horizontal" >
<input type="hidden" name="_token" id="csrf-token" value="{{ Session::token()}}" />
package com.example.aliso.sd.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;
import android.view.Menu;
import android.view.MenuItem;
@samuelloza
samuelloza / gist:1ae569ad974fbc3acf83c5761de61124
Created February 19, 2017 15:55
Facebook whitelisted Error
curl -i -X POST \
-d 'pretty=1' \
-d 'setting_type=domain_whitelisting' \
--data-urlencode 'whitelisted_domains=["YOUR_DOMAIN"]' \
-d 'domain_action_type=add' \
-d 'access_token=ACCESS_TOKEN' \
'https://graph.facebook.com/v2.8/me/thread_settings'
En el controller
$destinationPath = 'uploads/imagenes';
$extension = $request->file("image")->getClientOriginalExtension();
$fileName = rand(11111,99999).'.'.$extension;
$request->file($type)->move($destinationPath, $fileName);
$uri = $destinationPath."/".$fileName;
En la vista para crear
El nombre del $request->file("image") --> image es el mismo que el de name="image"
[{"name":"Bears","color":"Blue","position":{"x":177,"y":85},"modelclass":"Bear","increment":false,"timestamp":false,"softdelete":false,"column":[{"colid":"c217","name":"id","type":"increments","length":"0","order":0,"defaultvalue":"","enumvalue":""},{"colid":"c218","name":"name","type":"string","length":"200","order":1,"defaultvalue":"","enumvalue":""},{"colid":"c219","name":"danger_level","type":"string","length":"200","order":2,"defaultvalue":"","enumvalue":""}],"relation":[{"extramethods":"","foreignkeys":"","name":"fish","relatedmodel":"Fish","relationtype":"hasOne","usenamespace":""},{"extramethods":"","foreignkeys":"","name":"trees","relatedmodel":"Trees","relationtype":"hasMany","usenamespace":""},{"extramethods":"","foreignkeys":"bear_id, picnic_id","name":"picnics","relatedmodel":"Picnics","relationtype":"belongsToMany","usenamespace":""}],"seeding":[]},{"name":"Fish","color":"Yellow","position":{"x":1063,"y":14},"modelclass":"Fish","increment":false,"timestamp":false,"softdelete":false,"column":[{"c
@samuelloza
samuelloza / Crontab.class.php
Last active January 7, 2018 23:23 — forked from gustavgenberg/Crontab.class.php
Easy crontab manager for PHP. Uses shell_exec!
<?php
class Crontab {
/*
(c) Gustav Genberg 2017
This script uses PHP shell_exec! Make sure it is enabled before using!
Also make sure that the user running this script (usually www-data) have access to the crontab command!
@samuelloza
samuelloza / .txt
Last active February 8, 2018 14:55
Postgres restaurar copia de seguridad remota
Restaurar copia de seguridad remotamente
ELiminamos la copia de seguridad
dropdb -h 192.168.188.4 -p 5432 -U postgres -W siipp
Creamos la bd
createdb -h 192.168.188.4 -p 5432 -U postgres -W siipp
Restauramos la copia de seguridad
psql -h 192.168.188.4 -p 5432 -U postgres -W siipp < archivo.sql
<VirtualHost *:80>
ServerName siipp.tarija.gob.bo
ServerAlias www.siipp.tarija.gob.bo
DocumentRoot /var/www/html
# Alias /capacitacion /var/www/capacitacion/
<Directory "/var/www/html/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny