Skip to content

Instantly share code, notes, and snippets.

View AdriC1705's full-sized avatar
😃
Working from home

Adri Contreras AdriC1705

😃
Working from home
View GitHub Profile
public function guardarRespuesta(Request $request)
{
$idUser = $request->idUser;
$idQuestion = $request->question;
$answer = $request->answer;
try{
$ca = New Canswers();
$ca->updateOrCreate(
['id_users'=>$idUser, 'id_questions'=>$idQuestion],
$("#createform").on('submit',function (event){
// checar las validaciones de los campos
var name = $("#name").val();
var last_name = $("#last_name").val();
var email = $("#email").val();
var password = $("#password").val();
$.ajax({
url: 'crear-usuarios',
@media screen and (max-width: 425px) {
.qbootstrap-cover {
background-position-x: -300px !important;
}
div#qbootstrap-countdown {
background-position-x: -300px !important;
}
div#qbootstrap-started {
background-position-x: -250px !important;
background-position-y: 0 !important;
@AdriC1705
AdriC1705 / fn_test
Last active November 6, 2019 23:36
$('li#padre:not(:first-child)').on('click', function(){
var user = $(this).attr('idusuario');
console.log(user);
Organigrama(user);
});
function Organigrama (user) {
$.ajax({
type: "GET",
@AdriC1705
AdriC1705 / alternate_color_list.scss
Created October 17, 2019 17:32
Alternate colors in a list with css
li {
list-style: none;
padding: 8px 16px;
font-size: 16px;
text-transform: uppercase;
font-weight: 700;
border-top: 1px solid #dcdcdc;
background-color: #4d4a4b;
&:nth-child(odd) {
@font-face {
font-family: 'Fortescue';
src: url('fonts/fortescuepro-bold-webfont.woff') format('woff'),
url('fonts/fortescuepro-bold-webfont.woff2') format('woff2');
font-weight: normal;
font-style: normal;
}
import pywt
from PIL import Image
import numpy
import os
import Gnuplot
from time import *
def matriz(foto):
ancho,alto=foto.size
pixeles=foto.load()
def inversa(coeffis,escala):
inv = pywt.idwt2(coefficientes,'haar')
pixeles = escala.load()
ancho,alto = escala.size
for i in range(ancho):
for j in range(alto):
nuevo = int (inv[i,j])
pixeles[i,j] = (nuevo,nuevo,nuevo)
return escala
def binario(mat):
ancho = len(mat)
alto = len(mat[0])
nuevo = 0
foto = Image.new('RGBA',(ancho, alto)) #nueva imagen
pixeles = foto.load()
for i in range(ancho):
for j in range(alto):
if mat[i,j]<0:
nuevo = 0
def coeficientes(matrix):#Obtener los coefficientes 2D
coeffs=pywt.dwt2(matrix,'haar')
cA,(cH,cV,cD)=coeffs#cA=approximacion,cH=Detalle horizontal,cV=Detalle vertical,cD=Detalle diagonal
return (cA,cH,cV,cD),coeffs