Skip to content

Instantly share code, notes, and snippets.

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

Edgar Tec edgarjaviertec

🏠
Working from home
View GitHub Profile
#!/bin/bash
cd /var/www/html
NOW=$(date +%Y%m%d)
SQL_FILE=${NOW}_database.sql
# Backup database
wp db export ../backups/$SQL_FILE --add-drop-table
@pedroparra
pedroparra / store-example.js
Last active February 12, 2019 07:58
Ejemplo de store con redux.
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore } from 'redux';
// Preparamos nuestra funcion reducer
const myReducer = (state = 0, action) => {
switch(action.type) {
case 'sumar':
return state + 1;
case 'restar':
@tonymtz
tonymtz / uninstall_homebrew.sh
Created November 15, 2014 00:03
Uninstall Homebrew from OSX Yosemite
#!/bin/sh
function abort {
echo "$1"
exit 1
}
set -e
/usr/bin/which -s git || abort "brew install git first!"
@tim-reynolds
tim-reynolds / jquery.centerit.js
Created June 29, 2012 18:16
Setting scroll to center on an element (jQuery) - Super simple stuff
/*
If you have a horizontal (or vertical) scroll container and want to set the scroll to center a specific
element in the container you can use the following super simple technique.
I'm going to show you how it was derived, because it's important to know why, not just how.
*/
/*
Setup:
[HTML]
<div class="outer">