Instantly share code, notes, and snippets.

View lc-svg-upload.php
Plugin Name: SVG Upload
Plugin URI:
Description: Super PHP Plugin to add Full SVG Media support to WordPress, I should live in {$webroot}/wp-content/plugins/ folder ;)
Author: Lewis Cowles
Version: 1.5.8
Author URI:
View destructuring.js
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
View PHP - MySql - Dynamic Table Columns
$conn = mysqli_connect($ht, $ur, $pd);
mysqli_select_db($conn, $db);
//foreach req, check if the column exists, otherwise create it
foreach($_POST as $k => $v){
$key = trim(mysqli_real_escape_string($conn, $k));
# Something in lines of
# Make sure you have IMAP enabled in your gmail settings.
# Right now it won't download same file name twice even if their contents are different.
import email
import getpass, imaplib
import os
import sys
detach_dir = '.'
import email, getpass, imaplib, os
detach_dir = '.' # directory where to save attachments (default: current)
user = raw_input("Enter your GMail username:")
pwd = getpass.getpass("Enter your password: ")
# connecting to the gmail imap server
m = imaplib.IMAP4_SSL("")
m.login(user,pwd)"cs2043") # here you a can choose a mail box like INBOX instead
#!/usr/bin/env python
# Very simple Python script to dump all emails in an IMAP folder to files.
# This code is released into the public domain.
# RKI Nov 2013
import sys
import imaplib
import getpass
#!/usr/bin/env python
# Very basic example of using Python and IMAP to iterate over emails in a
# gmail folder/label. This code is released into the public domain.
# RKI July 2013
import sys
import imaplib
View gist:38ddb5625bf194a8dd224bc43c145fca
/* border-serrated - a zig zag triangle border with linear gradient
@mixin border-top-serrated($size, $color-outer) {
& {
position: relative;
overflow: auto;
padding-top: $size;
&:before {
top: 0px;
View columns.css
/* Column Classes
--------------------------------------------- */
View wp-localhost-requests.php
* Plugin Name: Allow localhost http requests.
* Plugin URI:
* Description: Note: Please don't use it on live website. If you are working locally, sometimes you get errors such as "A valid URL was not provided" or such, specially when you are interacting with website which is also hosted locally, so it becomes annoying at times to find the cause, and most of the time its wp_safe_remote_request, wp_safe_remote_get or wp_safe_remote_post functions who are the culprit. So this plugin is a quick fix.
* Author: saas786
* Version: 0.1
add_filter( 'http_request_host_is_external', 'wplr_http_request_host_is_external' );
function wplr_http_request_host_is_external(){