Skip to content

Instantly share code, notes, and snippets.

View kaskajp's full-sized avatar
🙈
ASCII stupid question, get a stupid ANSI!

Jonas Raneryd Imaizumi kaskajp

🙈
ASCII stupid question, get a stupid ANSI!
View GitHub Profile
//http://www.w3.org/TR/notifications/
//https://developer.mozilla.org/en-US/docs/Web/API/notification
//Notifier.isSupported
//
//Notifier.permission //"granted", "denied", or "default"
//
//Notifier.requestPermission([callback]) //first argument of callback is the current permission
//
//Notifier.notify(title[, options])
<?php
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
<?php /* This function attaches the image to the post in the database, add it to functions.php */
function insert_attachment($file_handler,$post_id,$setthumb='false') {
// check to make sure its a successful upload
if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) __return_false();
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
require_once(ABSPATH . "wp-admin" . '/includes/file.php');
require_once(ABSPATH . "wp-admin" . '/includes/media.php');
@kaskajp
kaskajp / 0_reuse_code.js
Created May 26, 2014 09:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console