⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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. */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class i18n | |
{ | |
private static $strings = [ | |
'WELCOME' => [ | |
'en' => 'Welcome', | |
'es' => 'Bienvenidos', | |
], | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Clone the repo | |
git clone --depth=1 git://someserver/somerepo dirformynewrepo | |
// Remove the .git directory | |
rm -rf !$/.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $1 == '' ]; then | |
v_valid=false; | |
#obtain the desired site name | |
while ! $v_valid; do | |
read -p "site name:" site_name |
OlderNewer