Skip to content

Instantly share code, notes, and snippets.

Avatar
🖖

Raam Dev raamdev

🖖
View GitHub Profile
View bitly.php
<?php
/**
* Plugin Name: Bit.ly
* Version: 1.2
* Author: Micah Ernst, Bradford Campeau-Laurion (Alley Interactive)
* Description: Uses bit.ly API to get shortened url for a post on publish and saves url as meta data. Based on TIME.com's Bit.ly plugin.
*/
if ( defined( 'WP_CLI' ) && WP_CLI )
require dirname( __FILE__ ) . '/class-wp-cli.php';
View googlecloud.html
<!DOCTYPE html>
<html>
<head>
<title>Welcome To Google Cloud | Kinsta</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600' rel='stylesheet' type='text/css'>
<style type='text/css'>
/* CSS RESET */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';
@raamdev
raamdev / custom-link-library-stylesheet.css
Created Jul 13, 2016
Link Library stylesheet used on raamdev.com
View custom-link-library-stylesheet.css
View reg-ex-bug-wp-redirects.inc.php
$to = preg_replace_callback('/%%\$(\_[a-zA-Z]+)(.+?)%%/i', 'wp_redirects\plugin::_url_e_gprcs_value', $to);
if(strlen($element_w_brackets = $m[2]) && preg_match('/^(?:(?:\[(["\'])[a-z0-9\._\-]+?\1\])|(?:\[[0-9]+\]))+$/i', $element_w_brackets))
View curl-localhost-test.php
<?php
$curl_localhost_test_success = FALSE;
$curl_localhost_test_url = 'http://'.$_SERVER['HTTP_HOST'];
$curl_localhost_test_url_return_string_frag = 'html';
if(is_resource($_curl_test_resource = curl_init()))
{
curl_setopt_array(
$_curl_test_resource, array(
CURLOPT_CONNECTTIMEOUT => 5, CURLOPT_TIMEOUT => 5,
@raamdev
raamdev / testing-wp-access-control-mu-plugin.md
Last active Mar 9, 2016
Testing WordPress Access Control using an MU Plugin
View testing-wp-access-control-mu-plugin.md

Testing WordPress Access Control using an MU Plugin

WARNING - MU plugin file for testing purposes only.

If you don't want to use the plugin and instead want to use a coded solution, the following below could be done for testing purposes. We highly recommend on using a plugin like User Switching over this method. The plugin method is likely to offer better security and it will be easier for most people.

Must-use plugins (a.k.a. mu-plugins) are plugins installed in a special directory inside the content folder and which are automatically enabled on all sites in the installation. Must-use plugins do not show in the default list of plugins on the Plugins page of wp-admin – although they do appear in a special Must-Use section – and cannot be disabled except by removing the plugin file from the must-use directory, which is found in wp-content/mu-plugins by default.

See: http://codex.wordpress.org/Must_Use_Plugins

@raamdev
raamdev / fpass.sh
Created Feb 5, 2016
Script to quickly search password store
View fpass.sh
#!/bin/bash
PATH_TO_PASS=/usr/local/bin/pass
PATH_TO_PASS_DIR=/Users/raam/.password-store
PATH_TO_FIND=/usr/bin/find
# Trims ".password-store/Personal/example.com.gpg" to
# "Personal/example.com" for use with the pass command
OFFSET=${#PATH_TO_PASS_DIR}
@raamdev
raamdev / f.lux-xcode-master-sha256.chk
Last active Nov 20, 2015
38f463ee5780a4f2b0160f9fa21dbe3c78c5d80d3c093e4ff553aaca230e2898 f.lux-xcode-master.zip
View f.lux-xcode-master-sha256.chk
5dfb0ac3bd39f2830283cd0a5af534c43024207bbec460ca089b8edd595070fa ./.gitignore
a326fb9457de2a31fd23fb98d89f1e83dcab611ea7b85f671680094592e51c54 ./AppIcon29x29@2x.png
d276420548696edcc16610b578907305f54020763e065581f4aa5863b8585c61 ./AppIcon29x29@3x.png
adab888cd5d24313f142e9324f10ff7128d77cb30031122bb3586e333ef399a2 ./AppIcon40x40@2x.png
8fdc77ccf3964c31eb31777479a7ca5c3c056d873da610f2d9b75c99fc363ae9 ./AppIcon40x40@3x.png
eb6f6aa969998b2648ade1ee051d37f01032e6f549fc77b195bf7e4c53bf2624 ./AppIcon60x60@2x.png
626b2f4146996ab876396c4ab797b005801fdf59aa6b57e976386f0572772895 ./AppIcon60x60@3x.png
eadf312d966754f3b8d6542ea8a5db850bcceb81e6f971b7b629bc4b950b8644 ./en.lproj/fluxController_iPhone.nib
9261ecceda608ef174256e5fdc774c1e6e3dcf533409c1bc393d490d01c713f1 ./en.lproj/InfoPlist.strings
ca34f2dc83c31222a73a48053532ad901de55f014c58ffa2fbcf6c202b5448b0 ./flux.beta/AppDelegate.h
View github-events.php
<?php
if(!defined('WPINC')) // MUST have WordPress.
exit('Do NOT access this file directly: '.basename(__FILE__));
add_action('init', 'github_events::init');
class github_events // Event handler.
{
# Configuration ###############################################
@raamdev
raamdev / browser-caching.htaccess
Created Jan 27, 2015
Enable Browser Caching for Apache (add this to the root .htaccess file on your site)
View browser-caching.htaccess
# Browser Caching
FileETag MTime Size
<IfModule expires_module>
ExpiresActive on
ExpiresDefault "access plus 1 week"
</IfModule>
You can’t perform that action at this time.