Skip to content

Instantly share code, notes, and snippets.

View xerardoo's full-sized avatar
🎯
Focusing

Lucio G Pazos xerardoo

🎯
Focusing
View GitHub Profile
@xerardoo
xerardoo / index.html
Created March 16, 2019 08:22
ejemoplo ajax
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Nuevo Contacto</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
@xerardoo
xerardoo / listusers.bash
Created January 11, 2018 17:54
List All Users on linux
#!/bin/bash
# Name: listusers.bash
# Purpose: List all normal user and system accounts in the system. Tested on RHEL / Debian Linux
# Author: Vivek Gite <www.cyberciti.biz>, under GPL v2.0+
# -----------------------------------------------------------------------------------
_l="/etc/login.defs"
_p="/etc/passwd"
## get mini UID limit ##
l=$(grep "^UID_MIN" $_l)
@xerardoo
xerardoo / functions.php
Last active September 18, 2015 18:45 — forked from gnikolopoulos/functions.php
Add Defer and Async Attributes to Render Blocking Javascript in WordPress
<?php
function defer_js_async($tag){
// scripts to defer.
$scripts_to_defer = array('script-name1.js', 'script-name2.js', 'script-name3.js');
// scripts to async.
$scripts_to_async = array('script-name1.js', 'script-name2.js', 'script-name3.js');
foreach($scripts_to_defer as $defer_script){
@xerardoo
xerardoo / httpd.conf
Last active August 29, 2015 14:19
comprimir gzip apache
#Fuente: http://blog.intropedro.com/es/content/activar-la-compresi%C3%B3n-gzip-en-apache-httpd
LoadModule deflate_module modules/mod_deflate.so
<IfModule mod_deflate.c>
# Activamos la compresión
SetOutputFilter DEFLATE
# Indicamos los tipos de contenido a comprimir
@xerardoo
xerardoo / restore_backup.mysqldatabases.txt
Last active August 29, 2015 14:11
Restore and Backup MySQL Databases .
Source: https://snipt.net/danfreak/backup-and-restore-all-mysql-databases-with-2-simple-commands/
#backup all databases in one file (eventually add the option --add-locks):
mysqldump -u username -p -–all-databases > file.sql
#backup all databases in one gzipped file:
mysqldump -u username -p -–all-databases | gzip > file.sql.gz
#restore all databases:
mysql -u username -p < file.sql
@xerardoo
xerardoo / nginx_commands
Created November 14, 2014 15:32
nginx / Windows Commands
nginx/Windows runs as a standard console application (not a service), and it can be managed using the following commands:
nginx -s stop fast shutdown
nginx -s quit graceful shutdown
nginx -s reload changing configuration, starting new worker processes with a new configuration, graceful shutdown of old worker processes
nginx -s reopen re-opening log files
@xerardoo
xerardoo / shimarray
Created November 12, 2014 22:36
Shim to Join to javascript arrays
/**
*@title Array.joinWith - shim by Joseph Myers 7/6/2013
*@href http://stackoverflow.com/questions/17500312/is-there-some-way-i-can-join-the-contents-of-two-javascript-arrays-much-like-i
*@notes: shim de javascript para hacer o emular "inner join" entre dos arrays de objetos
* */
if (!Array.prototype.joinWith) {
+function () {
Array.prototype.joinWith = function(that, by, select, omit) {
@xerardoo
xerardoo / Mexico
Created November 3, 2014 20:29
Ciudades y Estados de Mexico
{
"mexico":{
"estado":[
{
"id":1,
"iso":"MX-AGS",
"capital":"Aguascalientes",
"nombre":"AGUASCALIENTES",
"municipios":{
"municipio":[
@xerardoo
xerardoo / $httpProviderConfig
Created November 3, 2014 20:02
Enable CORS (cross-origin resource sharing) AngularJS
angular.module('myApp', ['myDepencencies'])
.config(function ($httpProvider) {
$httpProvider.defaults.useXDomain = true;
$httpProvider.defaults.withCredentials = true;
delete $httpProvider.defaults.headers.common["X-Requested-With"];
$httpProvider.defaults.headers.common["Accept"] = "application/json";
$httpProvider.defaults.headers.common["Content-Type"] = "application/json";
});
@xerardoo
xerardoo / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../core-ajax/core-ajax.html">
<link rel="import" href="../cool-clock/cool-clock.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;