Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Chofoteddy's full-sized avatar

Christopher Castaneira Chofoteddy

View GitHub Profile
@Chofoteddy
Chofoteddy / wp-admin-notice.js
Created October 13, 2021 00:55
WP Admin Notice is a simple object use to show user notifications.
/**
* WP Admin Notice with pure JavaScript
*
* This adds a dismissible admin notice to the WP admin with pure JavaScript.
* No jQuery or other dependencies. The admin notice will have a Dismiss icon
* just like the regular WP admin notices. When the icon is clicked, the message
* will go away.
*
* This script is and Object-Oriented implementation of @Isabelc post (see link below).
*
@Chofoteddy
Chofoteddy / bump-version.sh
Created December 22, 2017 05:53
Bump version is a single bash script that increase the version within a php file, according to the tag "version" of the PHPDoc standard.
#!/bin/bash
## Copyright (C) 2017 - All Rights Reserved
## Permission to copy/modify is granted under the MIT license
##
## Script: bump-version.sh
## Description: Increase the version within a php file, according to the tag @version
## of the PHPDoc standard
## Style: Shell Style Guide - https://google.github.io/styleguide/shell.xml
## Author: Christopher CM (@Chofoteddy)
## Created: 2017-12-16
@Chofoteddy
Chofoteddy / backup.sh
Last active August 29, 2015 14:05
Backup DB (MySQL), files and project folders. Place this file in the root of your project and give it execute permissions, then run it with the parameters you require.
#!/bin/bash
# By: @Chofoteddy
# Date: 21/Ago/2014
# Update: 27/Ago/2014
#
# ./backup.sh -u USER -p 'PASSWORD' -d NAMEDB
filelog='glog.log'
function datetime {
echo `date +%d/%m/%Y-%H:%M:%S`
@Chofoteddy
Chofoteddy / StorageObject.js
Last active August 29, 2015 14:02 — forked from jfsiii/gist:814784
get and set objects in localStorage and sessionStorage
// Forked from jfsiii https://gist.github.com/jfsiii/814784
// Forked from paul irish's https://gist.github.com/paulirish/601751
// desire: localStorage and sessionStorage should accept objects
// in fact they do according to spec.
// http://code.google.com/p/chromium/issues/detail?id=43666
// but so far that part isnt implemented anywhere.
// so we duckpunch set/getItem() to stringify/parse on the way in/out