Skip to content

Instantly share code, notes, and snippets.

@codex73
codex73 / r-boilerplate.css
Created May 1, 2012 03:33 — forked from navitronic/r-boilerplate.css
Responsive CSS boilerplate
/* Mobile / General Styles
---
Code up general styles and mobile styles, use media queries to adapt to larger displays.
Things for this section: Reset, Typography, Baseline grid, etc. Convenience methods for image-replacement, hiding, clearing etc.
*/
/* Desktop and iPad/Tablet specific styles. */
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/query.php
*/
$args = array(
<?php
function extractElementsFromWebPage($webPage, $tagName) {
//Creating a DOMDocument Object.
$dom = new DOMDocument;
//Parsing the HTML from the web page
if ($dom->loadHTML($webPage)) {
// Extracting the specified elements from the web page
@$elements = $dom->getElementsByTagName($tagName);
<?php
class i18n
{
private static $strings = [
'WELCOME' => [
'en' => 'Welcome',
'es' => 'Bienvenidos',
],
];
// http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_osx-carbon-i386.pkg
// Requires a hacked grunt-wkhtmltopdf/tasks/wkhtmltopdf.js file (attached to this gist)
module.exports = function(grunt)
{
grunt.initConfig(
{
shell: {
php2html: {

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
<?php
/* vars for export */
// database record to be exported
$db_record = 'XXXXXXXXX';
// optional where query
$where = 'WHERE 1 ORDER BY 1';
// filename for export
$csv_filename = 'db_export_'.$db_record.'_'.date('Y-m-d').'.csv';
// database variables
@codex73
codex73 / check_ssl_expires
Created December 1, 2014 20:54
SSL Expiration Check
#!/bin/sh
DEBUG=false
warning_days=90 # Number of days to warn about soon-to-expire certs
certs_to_check='serverA.test.co.uk:443
serverB.test.co.uk:8140
serverC.test.co.uk:443'
for CERT in $certs_to_check
do
// Clone the repo
git clone --depth=1 git://someserver/somerepo dirformynewrepo
// Remove the .git directory
rm -rf !$/.git
#!/bin/bash
if [ $1 == '' ]; then
v_valid=false;
#obtain the desired site name
while ! $v_valid; do
read -p "site name:" site_name